diff options
author | Zhenhui Xie <xiezh0831@yahoo.co.jp> | 2020-04-11 00:23:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-10 18:23:20 +0200 |
commit | b11fe2ad30a3506541dacf32821d7fd70125e9bf (patch) | |
tree | dbad9ed03ebc12291b7cd28bece6adf3141a87ff /src/segment.rs | |
parent | d21e1b897046fd4e4bbee4626c30eaf2a5fd3849 (diff) |
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
Diffstat (limited to 'src/segment.rs')
-rw-r--r-- | src/segment.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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<T>(&mut self, value: T) -> &mut Self where |