summaryrefslogtreecommitdiffstats
path: root/src/style.rs
diff options
context:
space:
mode:
authorMarco Ieni <11428655+MarcoIeni@users.noreply.github.com>2020-11-06 00:12:27 +0100
committerGitHub <noreply@github.com>2020-11-05 18:12:27 -0500
commit3dac4f7fa6451c446902583d2d2aa1358960fe7c (patch)
treeaa56fafc017bcea4346516400079234ee4a2bdae /src/style.rs
parent8c8ddc8a815997250419594dd506bca6313433a6 (diff)
fix some clippy warnings (#380)
Diffstat (limited to 'src/style.rs')
-rw-r--r--src/style.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/style.rs b/src/style.rs
index 7bf56c71..d25fc2f7 100644
--- a/src/style.rs
+++ b/src/style.rs
@@ -1,7 +1,6 @@
use std::borrow::Cow;
use std::fmt;
-use ansi_term;
use lazy_static::lazy_static;
use crate::ansi;
@@ -135,9 +134,8 @@ impl Style {
}
(false, None) => words.push("normal".to_string()),
}
- match self.ansi_term_style.background {
- Some(color) => words.push(color::color_to_string(color)),
- None => {}
+ if let Some(color) = self.ansi_term_style.background {
+ words.push(color::color_to_string(color))
}
words.join(" ")
}
@@ -155,10 +153,10 @@ pub fn ansi_term_style_equality(a: ansi_term::Style, b: ansi_term::Style) -> boo
..b
};
if a_attrs != b_attrs {
- return false;
+ false
} else {
- return ansi_term_color_equality(a.foreground, b.foreground)
- & ansi_term_color_equality(a.background, b.background);
+ ansi_term_color_equality(a.foreground, b.foreground)
+ & ansi_term_color_equality(a.background, b.background)
}
}
@@ -211,7 +209,7 @@ pub fn line_has_style_other_than<'a>(line: &str, styles: impl Iterator<Item = &'
return false;
}
}
- return true;
+ true
}
#[cfg(test)]