From b11fe2ad30a3506541dacf32821d7fd70125e9bf Mon Sep 17 00:00:00 2001 From: Zhenhui Xie Date: Sat, 11 Apr 2020 00:23:20 +0800 Subject: fix: Fix variable styles in string formatter (#1069) * fix: Fix styling in variables * fix: Fix clippy * fix: Allow passing styles down to segments with no style * fix: Fix clippy --- src/segment.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/segment.rs') diff --git a/src/segment.rs b/src/segment.rs index 73e24b9a8..13f527083 100644 --- a/src/segment.rs +++ b/src/segment.rs @@ -37,6 +37,11 @@ impl Segment { self } + /// Check if the segment has a style + pub fn has_style(&self) -> bool { + self.style.is_some() + } + /// Sets the value of the segment. pub fn set_value(&mut self, value: T) -> &mut Self where -- cgit v1.2.3