summaryrefslogtreecommitdiffstats
path: root/src/modules/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/mod.rs')
-rw-r--r--src/modules/mod.rs27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/modules/mod.rs b/src/modules/mod.rs
index 5fa37593e..42620db9f 100644
--- a/src/modules/mod.rs
+++ b/src/modules/mod.rs
@@ -3,37 +3,12 @@ mod directory;
mod line_break;
mod nodejs;
-use ansi_term::Style;
+use crate::segment::Segment;
use clap::ArgMatches;
// pub static current_dir: PathBuf = env::current_dir().expect("Unable to identify current directory");
// TODO: Currently gets the physical directory. Get the logical directory.
-pub struct Segment {
- pub style: Style,
- pub value: String,
- pub prefix: Option<Box<Segment>>,
- pub suffix: Option<Box<Segment>>,
-}
-
-impl Default for Segment {
- fn default() -> Segment {
- let default_suffix = Some(Box::new(Segment {
- style: Style::default(),
- value: String::from(" "),
- prefix: None,
- suffix: None,
- }));
-
- Segment {
- style: Style::default(),
- value: String::from(""),
- prefix: None,
- suffix: default_suffix,
- }
- }
-}
-
pub fn handle(module: &str, args: &ArgMatches) -> Segment {
match module {
"dir" | "directory" => directory::segment(&args),