Return the imported string as well
This commit is contained in:
parent
01ee30537e
commit
d0592d0029
1 changed files with 2 additions and 2 deletions
|
@ -27,14 +27,14 @@ impl<'a> Task<'a> {
|
||||||
Task(fle)
|
Task(fle)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn import<R: BufRead>(store: &'a Store, mut r: R) -> Result<(Task<'a>, Uuid)> {
|
pub fn import<R: BufRead>(store: &'a Store, mut r: R) -> Result<(Task<'a>, String, Uuid)> {
|
||||||
let mut line = String::new();
|
let mut line = String::new();
|
||||||
r.read_line(&mut line);
|
r.read_line(&mut line);
|
||||||
import_task(&line.as_str())
|
import_task(&line.as_str())
|
||||||
.map_err_into(TodoErrorKind::ImportError)
|
.map_err_into(TodoErrorKind::ImportError)
|
||||||
.and_then(|t| {
|
.and_then(|t| {
|
||||||
let uuid = t.uuid().clone();
|
let uuid = t.uuid().clone();
|
||||||
t.into_task(store).map(|t| (t, uuid))
|
t.into_task(store).map(|t| (t, line, uuid))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue