summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-11-26 16:43:14 -0600
committerToby Vincent <tobyv13@gmail.com>2022-11-26 16:43:14 -0600
commit46cee052d6d4b60b483ab6841af976d68d954705 (patch)
tree19bbe2170c5a2e6af3b306e14c942ccd1393228a /src/config.rs
parent0f428974b2d7f4cf59490904564e52d134b9ef3a (diff)
feat: add project filtering
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/config.rs b/src/config.rs
index 677b202..126b939 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,10 +1,11 @@
-use super::SearchPath;
use figment::{providers::Serialized, value, Figment, Metadata, Profile, Provider};
use serde::{Deserialize, Serialize};
+use crate::search;
+
#[derive(Debug, PartialEq, Eq, Clone, Default, Serialize, Deserialize)]
pub struct Config {
- pub(crate) paths: Vec<SearchPath>,
+ pub(crate) paths: Vec<search::entry::Config>,
}
impl Config {
@@ -57,20 +58,23 @@ mod tests {
config,
Config {
paths: Vec::from([
- SearchPath {
- path: "/path/to/projects".into(),
+ search::entry::Config {
+ path_buf: "/path/to/projects".into(),
hidden: false,
max_depth: None,
+ ..Default::default()
},
- SearchPath {
- path: "/path/to/other_projects".into(),
+ search::entry::Config {
+ path_buf: "/path/to/other_projects".into(),
hidden: true,
max_depth: Some(1),
+ ..Default::default()
},
- SearchPath {
- path: "/path/to/another_project".into(),
+ search::entry::Config {
+ path_buf: "/path/to/another_project".into(),
hidden: false,
max_depth: Some(0),
+ ..Default::default()
},
]),
}