Closed theduke closed 4 years ago
There's Crate::new_checked()
now. You can iterate over crates yourself. I use this:
let indexed_crates: Result<HashMap<_,_>, _> = crates_io_index.crate_index_paths()
.par_bridge() // rayon
.filter_map(|path| {
let c = crates_index::Crate::new_checked(path)?;
Ok((c.name().to_ascii_lowercase(), c))
})
.collect();
Useful crate!
I just have one issue: the implementation uses a whole lot of
.unwrap()
. It's unlikely for failures to occur but very much possible, mostly with IO errors (think directory moved, disk inaccessible, ...) which can become an issue in a long running application.It would be great to have
Crates
beIterator<Item = Result<Crate, Error>>
instead.