From fa956cc1598f69c81d6db54b4e2e8f5f35cd9b23 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Wed, 30 Nov 2022 02:01:47 -0600 Subject: fix: fix config serialization and reorganize project --- src/search/entry.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/search/entry.rs') 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 for Entry { - fn from(config: Config) -> Self { +impl From 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 { -- cgit v1.2.3-70-g09d2