From 78c2425bbd08621aa2145d5d21b931b6b5024438 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 17 Jun 2017 17:21:05 +0200 Subject: [PATCH] Redo StoreId creation in iterator --- libimagtimetrack/src/iter/storeid.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libimagtimetrack/src/iter/storeid.rs b/libimagtimetrack/src/iter/storeid.rs index cbfbfed1..ecab55da 100644 --- a/libimagtimetrack/src/iter/storeid.rs +++ b/libimagtimetrack/src/iter/storeid.rs @@ -55,20 +55,19 @@ impl Iterator for TagStoreIdIter { type Item = Result<(StoreId, NDT), TimeTrackError>; fn next(&mut self) -> Option { + use module_path::ModuleEntryPath; + use libimagstore::storeid::IntoStoreId; + self.inner .next() .map(|res| { res.and_then(|tag| { let dt = self.datetime.format(DATE_TIME_FORMAT).to_string(); let id_str = format!("{}-{}", dt, tag.as_str()); - let id_str = PathBuf::from(id_str); - - StoreId::new_baseless(id_str) + ModuleEntryPath::new(id_str) + .into_storeid() .map_err_into(TTEK::StoreIdError) - .map(|id| ( - id, - self.datetime.clone() - )) + .map(|id| (id, self.datetime.clone())) }) }) }