summaryrefslogtreecommitdiffstats
path: root/src/modules/directory.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/directory.rs')
-rw-r--r--src/modules/directory.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/directory.rs b/src/modules/directory.rs
index 6ea6f71c3..d62a41f67 100644
--- a/src/modules/directory.rs
+++ b/src/modules/directory.rs
@@ -15,7 +15,7 @@ use std::path::Path;
///
/// **Truncation**
/// Paths will be limited in length to `3` path components by default.
-pub fn segment(_: &ArgMatches) -> Segment {
+pub fn segment(_: &ArgMatches) -> Option<Segment> {
const HOME_SYMBOL: &str = "~";
const DIR_TRUNCATION_LENGTH: usize = 3;
const SECTION_COLOR: Color = Color::Cyan;
@@ -44,8 +44,9 @@ pub fn segment(_: &ArgMatches) -> Segment {
segment
.set_value(truncated_dir_string)
- .set_style(SECTION_COLOR.bold())
- .clone()
+ .set_style(SECTION_COLOR.bold());
+
+ Some(segment)
}
/// Get the root directory of a git repo