mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-26 12:17:19 +02:00
Make some cargo clippy changes
This commit is contained in:
parent
8071558dbe
commit
a6ab282442
2 changed files with 5 additions and 6 deletions
|
@ -232,9 +232,8 @@ impl<'a> Widget for Calendar<'a> {
|
||||||
};
|
};
|
||||||
let mut style = Style::default();
|
let mut style = Style::default();
|
||||||
let index = self.date_style.iter().position(|(date, style)| d.1 == *date);
|
let index = self.date_style.iter().position(|(date, style)| d.1 == *date);
|
||||||
match index {
|
if let Some(i) = index {
|
||||||
Some(i) => style = self.date_style[i].1,
|
style = self.date_style[i].1
|
||||||
None => (),
|
|
||||||
}
|
}
|
||||||
if d.1 == Local::today().naive_local() {
|
if d.1 == Local::today().naive_local() {
|
||||||
buf.set_string(x, y, s, style.add_modifier(Modifier::BOLD));
|
buf.set_string(x, y, s, style.add_modifier(Modifier::BOLD));
|
||||||
|
@ -242,7 +241,7 @@ impl<'a> Widget for Calendar<'a> {
|
||||||
buf.set_string(x, y, s, style);
|
buf.set_string(x, y, s, style);
|
||||||
}
|
}
|
||||||
x += 3;
|
x += 3;
|
||||||
d.1 = d.1 + Duration::days(1);
|
d.1 += Duration::days(1);
|
||||||
}
|
}
|
||||||
moredays |= d.0.month() == d.1.month() || d.1 < d.0;
|
moredays |= d.0.month() == d.1.month() || d.1 < d.0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ impl TConfig {
|
||||||
let mut color_collection = HashMap::new();
|
let mut color_collection = HashMap::new();
|
||||||
for line in data.split('\n') {
|
for line in data.split('\n') {
|
||||||
if line.starts_with("color.") {
|
if line.starts_with("color.") {
|
||||||
let mut i = line.split(" ");
|
let mut i = line.split(' ');
|
||||||
let attribute = i.next();
|
let attribute = i.next();
|
||||||
let line = i.collect::<Vec<_>>().join(" ");
|
let line = i.collect::<Vec<_>>().join(" ");
|
||||||
let line = line.trim_start_matches(' ');
|
let line = line.trim_start_matches(' ');
|
||||||
|
@ -117,7 +117,7 @@ impl TConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_tcolor(line: &str) -> TColor {
|
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));
|
let (mut foreground, mut background) = (String::from(foreground), String::from(background));
|
||||||
background = background.replace("on ", "");
|
background = background.replace("on ", "");
|
||||||
let mut modifiers = vec![];
|
let mut modifiers = vec![];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue