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

Cleanup index initialization #116

Closed Jake-Shadle closed 1 year ago

Jake-Shadle commented 1 year ago

This exposes a new get_index_details function that takes a url and turns it into the disk location, rooted at the optional location or CARGO_HOME/cargo default, as well as the canonicalized url. This also adds SparseIndex::with_path which allows a user to easily create a sparse index at the specific location but still with the same layout as cargo and not be dependent on CARGO_HOME. This meant sparse_index::test::parses_cache could be drastically simplified to remove the mucking about with environment variables.

kornelski commented 1 year ago

Thank you for splitting the PR. That went much smoother.