mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-22 20:23:09 +02:00
add cargo clippy to CI
This commit is contained in:
parent
2232aa8083
commit
ca70d2c914
12 changed files with 98 additions and 93 deletions
|
@ -29,8 +29,8 @@ subcommand_invocation! {
|
|||
let mut t = Table::new();
|
||||
t.set_format(table::format());
|
||||
t.set_titles(row![b->"id", b->"description"]);
|
||||
for i in 1..working_set.len() {
|
||||
if let Some(ref task) = working_set[i] {
|
||||
for (i, item) in working_set.iter().enumerate() {
|
||||
if let Some(ref task) = item {
|
||||
t.add_row(row![i, task.get_description()]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,22 +12,16 @@ pub(super) fn get_task<S: AsRef<str>>(replica: &mut Replica, task_arg: S) -> Fal
|
|||
let task_arg = task_arg.as_ref();
|
||||
|
||||
// first try treating task as a working-set reference
|
||||
match task_arg.parse::<usize>() {
|
||||
Ok(i) => {
|
||||
if let Some(task) = replica.get_working_set_task(i)? {
|
||||
return Ok(task);
|
||||
}
|
||||
if let Ok(i) = task_arg.parse::<usize>() {
|
||||
if let Some(task) = replica.get_working_set_task(i)? {
|
||||
return Ok(task);
|
||||
}
|
||||
Err(_) => {}
|
||||
}
|
||||
|
||||
match Uuid::parse_str(task_arg) {
|
||||
Ok(uuid) => {
|
||||
if let Some(task) = replica.get_task(&uuid)? {
|
||||
return Ok(task);
|
||||
}
|
||||
if let Ok(uuid) = Uuid::parse_str(task_arg) {
|
||||
if let Some(task) = replica.get_task(&uuid)? {
|
||||
return Ok(task);
|
||||
}
|
||||
Err(_) => {}
|
||||
}
|
||||
|
||||
Err(format_err!("Cannot interpret {:?} as a task", task_arg))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue