Make some cargo clippy changes

This commit is contained in:
Dheepak Krishnamurthy 2020-10-22 21:52:00 -06:00
parent 8071558dbe
commit a6ab282442
2 changed files with 5 additions and 6 deletions

View file

@ -102,7 +102,7 @@ impl TConfig {
let mut color_collection = HashMap::new();
for line in data.split('\n') {
if line.starts_with("color.") {
let mut i = line.split(" ");
let mut i = line.split(' ');
let attribute = i.next();
let line = i.collect::<Vec<_>>().join(" ");
let line = line.trim_start_matches(' ');
@ -117,7 +117,7 @@ impl TConfig {
}
fn get_tcolor(line: &str) -> TColor {
let (foreground, background) = line.split_at(line.to_lowercase().find("on ").unwrap_or(line.len()));
let (foreground, background) = line.split_at(line.to_lowercase().find("on ").unwrap_or_else( || line.len()));
let (mut foreground, mut background) = (String::from(foreground), String::from(background));
background = background.replace("on ", "");
let mut modifiers = vec![];