Add observability using the tracing crate

This commit is contained in:
2022-01-10 14:41:11 +01:00
parent cbdf35eb53
commit 067838b159
10 changed files with 364 additions and 192 deletions

View File

@@ -12,7 +12,7 @@ impl TryFrom<&taskwarrior::Task> for Task {
if cs_string.is_empty() || cs_string == "{}" {
Ok(None)
} else {
Some(serde_json::from_str(&cs_string)).transpose()
Some(serde_json::from_str(cs_string)).transpose()
}
},
)?;
@@ -39,7 +39,7 @@ impl TryFrom<&taskwarrior::Task> for Task {
pub fn export(filters: Vec<&str>) -> Result<Vec<Task>, Error> {
let tasks: Result<Vec<Task>, Error> = taskwarrior::export(filters)?
.iter()
.map(|task| Task::try_from(task))
.map(Task::try_from)
.collect();
tasks
}