From c664b588518e12de901bfe4a8ba2242893e4ff3d Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Sun, 27 Nov 2022 19:42:25 -0600 Subject: refactor: add type alias for boxed project --- src/project.rs | 2 ++ src/search.rs | 7 ++----- src/search/entry.rs | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/project.rs b/src/project.rs index b13d4a7..5f1edc5 100644 --- a/src/project.rs +++ b/src/project.rs @@ -11,6 +11,8 @@ mod error; mod git; mod path; +pub type ProjectItem = Box>; + pub trait Timestamp { type Error; diff --git a/src/search.rs b/src/search.rs index 65fd295..2aff5ae 100644 --- a/src/search.rs +++ b/src/search.rs @@ -1,14 +1,11 @@ use figment::Provider; use std::vec::IntoIter; -use crate::{Config, Result}; - -pub use entry::Entry; +use self::entry::Entry; +use crate::{project::ProjectItem, Config, Result}; pub mod entry; -type ProjectItem = Box>; - pub struct Search { iter: IntoIter, curr: Option, diff --git a/src/search/entry.rs b/src/search/entry.rs index ab9da38..1ac20fc 100644 --- a/src/search/entry.rs +++ b/src/search/entry.rs @@ -2,7 +2,7 @@ use ignore::{DirEntry, Walk}; use tracing::error; use crate::{ - project::{GitProject, PathProject}, + project::{GitProject, PathProject, ProjectItem}, Project, }; @@ -45,7 +45,7 @@ impl Entry { } impl Iterator for Entry { - type Item = Box>; + type Item = ProjectItem; #[tracing::instrument] fn next(&mut self) -> Option { -- cgit v1.2.3-70-g09d2