Redo StoreId creation in iterator

This commit is contained in:
Matthias Beyer 2017-06-17 17:21:05 +02:00
parent 61616673cb
commit 78c2425bbd

View file

@ -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()
))
}) })
}) })
} }