mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-22 20:23:09 +02:00
use Replica::get_working_set_task
This commit is contained in:
parent
fc668e5ca8
commit
2dd86edd4a
1 changed files with 3 additions and 6 deletions
|
@ -13,15 +13,12 @@ pub(super) fn get_task<S: AsRef<str>>(replica: &mut Replica, task_arg: S) -> Fal
|
||||||
let task_arg = task_arg.as_ref();
|
let task_arg = task_arg.as_ref();
|
||||||
|
|
||||||
// first try treating task as a working-set reference
|
// first try treating task as a working-set reference
|
||||||
match task_arg.parse::<u64>() {
|
match task_arg.parse::<usize>() {
|
||||||
Ok(i) => {
|
Ok(i) => {
|
||||||
let mut working_set = replica.working_set().unwrap();
|
if let Some(task) = replica.get_working_set_task(i)? {
|
||||||
if i > 0 && i < working_set.len() as u64 {
|
|
||||||
if let Some(task) = working_set[i as usize].take() {
|
|
||||||
return Ok(task);
|
return Ok(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Err(_) => {}
|
Err(_) => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue