summaryrefslogtreecommitdiffstats
path: root/src/search/entry.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-11-27 19:23:11 -0600
committerToby Vincent <tobyv13@gmail.com>2022-11-27 19:23:11 -0600
commitc7319caf38ff22e67f6fb625411ed554cf3b1f92 (patch)
tree82882b77fa97052c150f49eb16e2d28ee2d78763 /src/search/entry.rs
parent46cee052d6d4b60b483ab6841af976d68d954705 (diff)
feat: improve Project trait
Diffstat (limited to 'src/search/entry.rs')
-rw-r--r--src/search/entry.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/search/entry.rs b/src/search/entry.rs
index 6e94b35..ab9da38 100644
--- a/src/search/entry.rs
+++ b/src/search/entry.rs
@@ -24,7 +24,10 @@ impl std::fmt::Debug for Entry {
}
impl Entry {
- pub fn match_project(&self, dir_entry: DirEntry) -> Option<Box<dyn Project>> {
+ pub fn parse_dir_entry(
+ &self,
+ dir_entry: DirEntry,
+ ) -> Option<Box<dyn Project<Error = crate::project::Error>>> {
if self.config.git {
if let Ok(git) = GitProject::try_from(dir_entry.to_owned()) {
return Some(Box::new(git));
@@ -42,12 +45,12 @@ impl Entry {
}
impl Iterator for Entry {
- type Item = Box<dyn Project>;
+ type Item = Box<dyn Project<Error = crate::project::Error>>;
#[tracing::instrument]
fn next(&mut self) -> Option<Self::Item> {
match self.iter.next()? {
- Ok(dir_entry) => self.match_project(dir_entry),
+ Ok(dir_entry) => self.parse_dir_entry(dir_entry),
Err(err) => {
error!(%err, "Ignoring errored path");
self.next()