use std::{io::ErrorKind, path::PathBuf}; use crate::{parser::Parser, project::Project}; #[derive(Debug, Clone)] pub struct PathMatcher(pub String); impl Parser for PathMatcher { type Error = std::io::Error; #[tracing::instrument] fn parse(&self, path_buf: PathBuf) -> Result { if !path_buf.join(&self.0).exists() { return Err(std::io::Error::from(ErrorKind::NotFound)); } path_buf.try_into() } }