Autoformat changes

This commit is contained in:
Dheepak Krishnamurthy 2020-08-02 12:34:39 -06:00
parent 0ac3996443
commit e7d33c6749
2 changed files with 21 additions and 16 deletions

View file

@ -1,4 +1,4 @@
use crate::color::{TColor};
use crate::color::TColor;
use std::cmp::Ordering;
use std::convert::TryInto;
@ -369,20 +369,26 @@ impl TTApp {
let ctasks = self.tasks.clone();
let blocking = self.colors.blocking;
let blocked = self.colors.blocked;
let rows = tasks
.iter()
.enumerate()
.map(|(i, val)|
if ctasks[i].tags().unwrap_or(&vec![]).join(" ").contains(&"BLOCKED".to_string()) {
Row::StyledData(val.iter(), normal_style)
} else if ctasks[i].tags().unwrap_or(&vec![]).contains(&"BLOCKING".to_string()) {
Row::StyledData(val.iter(), normal_style.fg(blocking))
} else if ctasks[i].due().is_some() {
Row::StyledData(val.iter(), normal_style)
} else {
Row::StyledData(val.iter(), normal_style)
}
);
let rows = tasks.iter().enumerate().map(|(i, val)| {
if ctasks[i]
.tags()
.unwrap_or(&vec![])
.join(" ")
.contains(&"BLOCKED".to_string())
{
Row::StyledData(val.iter(), normal_style)
} else if ctasks[i]
.tags()
.unwrap_or(&vec![])
.contains(&"BLOCKING".to_string())
{
Row::StyledData(val.iter(), normal_style.fg(blocking))
} else if ctasks[i].due().is_some() {
Row::StyledData(val.iter(), normal_style)
} else {
Row::StyledData(val.iter(), normal_style)
}
});
let constraints: Vec<Constraint> = widths
.iter()
.map(|i| {

View file

@ -345,7 +345,6 @@ impl TColor {
}
}
#[cfg(test)]
mod tests {
use crate::color::TColor;