frewsxcv / rust-crates-index

Rust library for retrieving and interacting with the crates.io index
https://docs.rs/crates-index/
Apache License 2.0
72 stars 37 forks source link

Expose Crate::from_slice #38

Closed jyn514 closed 4 years ago

jyn514 commented 4 years ago

Right now the only public method to construct a crate is Crate::new, which requires a filename. However if the file is stored in a git compressed packfile, it may not have its own filename (see https://github.com/rust-lang/docs.rs/pull/898#discussion_r461501149). Since Crate::new trivially calls Crate::from_slice after, is it possible to expose that as a public method?

cc @nemo157

kornelski commented 4 years ago

Done