diff options
author | Toby Vincent <tobyv13@gmail.com> | 2023-05-04 19:43:08 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2023-05-04 19:43:08 -0500 |
commit | 5da4fb25f9bb72771c7f2798daa6339be0bc3900 (patch) | |
tree | c30639c7a95e1d94baff498d247eed43fdb3728e /src/project/path.rs | |
parent | 589cd987217755e1da7acbc304c373a75a9f7db5 (diff) |
refactor: join iterators into a single walk
Diffstat (limited to 'src/project/path.rs')
-rw-r--r-- | src/project/path.rs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/project/path.rs b/src/project/path.rs deleted file mode 100644 index 0e38990..0000000 --- a/src/project/path.rs +++ /dev/null @@ -1,22 +0,0 @@ -use std::{io::ErrorKind, path::PathBuf}; - -use super::{Project, ProjectParser}; - -#[derive(Debug, Clone)] -pub enum PathMatcher { - All, - Pattern(String), -} - -impl ProjectParser for PathMatcher { - #[tracing::instrument] - fn parse(&self, path_buf: PathBuf) -> Result<Project, Box<dyn std::error::Error>> { - let project = match self { - PathMatcher::All => path_buf.try_into()?, - PathMatcher::Pattern(p) if path_buf.join(p).exists() => path_buf.try_into()?, - _ => return Err(Box::new(std::io::Error::from(ErrorKind::NotFound))), - }; - - Ok(project) - } -} |