summaryrefslogtreecommitdiffstats
path: root/src/segment.rs
diff options
context:
space:
mode:
authorNeil Kistner <neil.kistner@gmail.com>2019-09-16 00:03:44 -0500
committerKevin Song <chipbuster@users.noreply.github.com>2019-09-16 00:03:44 -0500
commitaa26c5bca450f049079a0e85da125b4d20c8ffec (patch)
treee861f12382c6a22452679371c2f20af5a2dfde88 /src/segment.rs
parent121c55bac554bc99868f3e7e70782ceaf068d03c (diff)
fix: Update Module::is_empty to check value of segments (#332)
Previously, a set of empty segments would cause the module to print. This changes the logic of Module::is_empty to check that all the segments are empty instead.
Diffstat (limited to 'src/segment.rs')
-rw-r--r--src/segment.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/segment.rs b/src/segment.rs
index ebae80d51..8c0140ac1 100644
--- a/src/segment.rs
+++ b/src/segment.rs
@@ -52,6 +52,11 @@ impl Segment {
None => ANSIString::from(&self.value),
}
}
+
+ /// Determines if the segment contains a value.
+ pub fn is_empty(&self) -> bool {
+ self.value.trim().is_empty()
+ }
}
impl fmt::Display for Segment {