impl Into<StoreIdIterator> for GlobStoreIdIterator to be able to convert easily

This commit is contained in:
Matthias Beyer 2016-05-13 14:48:20 +02:00
parent 839ec051a4
commit dd7e146081

View file

@ -438,7 +438,8 @@ impl Store {
debug!("glob()ing with '{}'", path);
glob(&path[..]).map_err(|e| SE::new(SEK::GlobError, Some(Box::new(e))))
})
.map(|paths| StoreIdIterator::new(Box::new(GlobStoreIdIterator::new(paths))))
.map(|paths| GlobStoreIdIterator::new(paths).into())
.map_err(|e| SE::new(SEK::GlobError, Some(Box::new(e))))
}
// Walk the store tree for the module
@ -1299,6 +1300,7 @@ mod glob_store_iter {
use std::fmt::Error as FmtError;
use glob::Paths;
use storeid::StoreId;
use storeid::StoreIdIterator;
pub struct GlobStoreIdIterator {
paths: Paths,
@ -1312,6 +1314,14 @@ mod glob_store_iter {
}
impl Into<StoreIdIterator> for GlobStoreIdIterator {
fn into(self) -> StoreIdIterator {
StoreIdIterator::new(Box::new(self))
}
}
impl GlobStoreIdIterator {
pub fn new(paths: Paths) -> GlobStoreIdIterator {