Fix: Use StoreIdWithBase::from_full_path
We iterate over full pathes to store entries here, which causes `StoreId::new()` to error. But if we use the internal parsing helper `StoreIdWithBase::from_full_path()` and then call `::into_storeid()` on the resulting object, everything is fine. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
ed862db76f
commit
37bf2ce191
1 changed files with 10 additions and 1 deletions
|
@ -186,9 +186,18 @@ impl<'a> Entries<'a> {
|
|||
/// Revisit whether this can be done in a cleaner way. See commit message for why this is
|
||||
/// needed.
|
||||
pub fn into_storeid_iter(self) -> StoreIdIterator {
|
||||
use storeid::StoreIdWithBase;
|
||||
use storeid::IntoStoreId;
|
||||
|
||||
let storepath = self.1.path().to_path_buf();
|
||||
|
||||
let iter = self.0
|
||||
.into_inner()
|
||||
.map(|r| r.and_then(StoreId::new));
|
||||
.map(move |r| {
|
||||
r.and_then(|path| {
|
||||
StoreIdWithBase::from_full_path(&storepath, path)?.into_storeid()
|
||||
})
|
||||
});
|
||||
StoreIdIterator::new(Box::new(iter))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue