Redo StoreId creation in iterator
This commit is contained in:
parent
61616673cb
commit
78c2425bbd
1 changed files with 6 additions and 7 deletions
|
@ -55,20 +55,19 @@ impl Iterator for TagStoreIdIter {
|
||||||
type Item = Result<(StoreId, NDT), TimeTrackError>;
|
type Item = Result<(StoreId, NDT), TimeTrackError>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
|
use module_path::ModuleEntryPath;
|
||||||
|
use libimagstore::storeid::IntoStoreId;
|
||||||
|
|
||||||
self.inner
|
self.inner
|
||||||
.next()
|
.next()
|
||||||
.map(|res| {
|
.map(|res| {
|
||||||
res.and_then(|tag| {
|
res.and_then(|tag| {
|
||||||
let dt = self.datetime.format(DATE_TIME_FORMAT).to_string();
|
let dt = self.datetime.format(DATE_TIME_FORMAT).to_string();
|
||||||
let id_str = format!("{}-{}", dt, tag.as_str());
|
let id_str = format!("{}-{}", dt, tag.as_str());
|
||||||
let id_str = PathBuf::from(id_str);
|
ModuleEntryPath::new(id_str)
|
||||||
|
.into_storeid()
|
||||||
StoreId::new_baseless(id_str)
|
|
||||||
.map_err_into(TTEK::StoreIdError)
|
.map_err_into(TTEK::StoreIdError)
|
||||||
.map(|id| (
|
.map(|id| (id, self.datetime.clone()))
|
||||||
id,
|
|
||||||
self.datetime.clone()
|
|
||||||
))
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue