diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-11-30 02:01:47 -0600 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-11-30 02:01:47 -0600 |
commit | fa956cc1598f69c81d6db54b4e2e8f5f35cd9b23 (patch) | |
tree | afb753d7dd999efb864af6dde3fb28633d86a41c /src/search/entry.rs | |
parent | b32d10b65ee7bdd939915f2a34929386ac4595ea (diff) |
fix: fix config serialization and reorganize project
Diffstat (limited to 'src/search/entry.rs')
-rw-r--r-- | src/search/entry.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/search/entry.rs b/src/search/entry.rs index 6cd601c..9e58962 100644 --- a/src/search/entry.rs +++ b/src/search/entry.rs @@ -2,21 +2,18 @@ use ignore::{Walk, WalkBuilder}; use tracing::error; use crate::{ + config::Entry, project::{path::PathMatcher, ProjectParser, ProjectParserGroup}, search::ProjectItem, }; -pub use config::Config; - -mod config; - -pub struct Entry { +pub struct EntryIter { parsers: ProjectParserGroup, iter: Walk, } -impl Entry { - fn new(config: &Config) -> Self { +impl EntryIter { + fn new(config: &Entry) -> Self { let iter = WalkBuilder::new(&config.path_buf) .standard_filters(true) .max_depth(config.max_depth) @@ -38,13 +35,13 @@ impl Entry { } } -impl From<Config> for Entry { - fn from(config: Config) -> Self { +impl From<Entry> for EntryIter { + fn from(config: Entry) -> Self { Self::new(&config) } } -impl Iterator for Entry { +impl Iterator for EntryIter { type Item = ProjectItem; fn next(&mut self) -> Option<Self::Item> { |