forked from janek/mostr
style: reformat code
This commit is contained in:
parent
a3a732879f
commit
79b42b8df0
|
@ -51,7 +51,7 @@ fn format_tag(tag: &Tag) -> String {
|
||||||
Some(TagStandard::Hashtag(content)) => format!("#{content}"),
|
Some(TagStandard::Hashtag(content)) => format!("#{content}"),
|
||||||
_ => tag.content().map_or_else(
|
_ => tag.content().map_or_else(
|
||||||
|| format!("Kind {}", tag.kind()),
|
|| format!("Kind {}", tag.kind()),
|
||||||
|content| content.to_string()
|
|content| content.to_string(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
15
src/main.rs
15
src/main.rs
|
@ -8,8 +8,9 @@ use std::ops::Sub;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
use std::sync::mpsc::{Sender};
|
use std::sync::mpsc::Sender;
|
||||||
use chrono::{DateTime};
|
|
||||||
|
use chrono::DateTime;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use log::{debug, error, info, trace, warn};
|
use log::{debug, error, info, trace, warn};
|
||||||
|
@ -290,7 +291,7 @@ async fn main() {
|
||||||
tasks.add_or_remove_property_column(arg);
|
tasks.add_or_remove_property_column(arg);
|
||||||
} else {
|
} else {
|
||||||
println!("{}", PROPERTY_COLUMNS);
|
println!("{}", PROPERTY_COLUMNS);
|
||||||
continue
|
continue;
|
||||||
},
|
},
|
||||||
|
|
||||||
Some(',') => {
|
Some(',') => {
|
||||||
|
@ -300,8 +301,8 @@ async fn main() {
|
||||||
|| info!("With a task selected, use ,NOTE to attach NOTE and , to list all its notes"),
|
|| info!("With a task selected, use ,NOTE to attach NOTE and , to list all its notes"),
|
||||||
|task| println!("{}", task.description_events().map(|e| format!("{} {}", e.created_at.to_human_datetime(), e.content)).join("\n")),
|
|task| println!("{}", task.description_events().map(|e| format!("{} {}", e.created_at.to_human_datetime(), e.content)).join("\n")),
|
||||||
);
|
);
|
||||||
continue
|
continue;
|
||||||
},
|
}
|
||||||
Some(arg) => tasks.make_note(arg),
|
Some(arg) => tasks.make_note(arg),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -336,7 +337,7 @@ async fn main() {
|
||||||
Some(arg) => tasks.set_tag(arg.to_string()),
|
Some(arg) => tasks.set_tag(arg.to_string()),
|
||||||
None => {
|
None => {
|
||||||
println!("Hashtags of all known tasks:\n{}", tasks.all_hashtags().join(" "));
|
println!("Hashtags of all known tasks:\n{}", tasks.all_hashtags().join(" "));
|
||||||
continue
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -440,7 +441,7 @@ async fn main() {
|
||||||
selected_relay = new_relay;
|
selected_relay = new_relay;
|
||||||
}
|
}
|
||||||
//or_print(tasks.print_tasks());
|
//or_print(tasks.print_tasks());
|
||||||
continue
|
continue;
|
||||||
} else {
|
} else {
|
||||||
tasks.filter_or_create(&input);
|
tasks.filter_or_create(&input);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
use std::collections::{BTreeSet, HashMap};
|
use std::collections::{BTreeSet, HashMap};
|
||||||
use std::io::{Error, stdout, Write};
|
use std::io::{Error, stdout, Write};
|
||||||
use std::iter::{once, Sum};
|
use std::iter::once;
|
||||||
use std::ops::{Div, Rem};
|
use std::ops::{Div, Rem};
|
||||||
use std::sync::mpsc::Sender;
|
use std::sync::mpsc::Sender;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use chrono::{DateTime, Local, TimeZone};
|
use chrono::{DateTime, Local, TimeZone};
|
||||||
use chrono::LocalResult::Single;
|
use chrono::LocalResult::Single;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
|
|
Loading…
Reference in New Issue