Function cargo_update::ops::get_index_url
source · pub fn get_index_url(
crates_file: &Path,
registry: &str,
registries_crates_io_protocol_sparse: bool
) -> Result<(String, bool, Cow<'static, str>), Cow<'static, str>>
Expand description
Get the URL to update index from, whether it’s “sparse”, and the cargo name for it from the config file parallel to the specified crates file
First gets the source name corresponding to the given URL, if appropriate,
then chases the source.$SRCNAME.replace-with
chain,
then retrieves the URL from source.$SRCNAME.registry
of the final source.
Prepopulates with source.crates-io.registry = "https://github.com/rust-lang/crates.io-index"
,
as specified in the book
If registries_crates_io_protocol_sparse
, https://github.com/rust-lang/crates.io-index
is replaced with
sparse+https://index.crates.io/
.
Consult #107 and the Cargo Book for details: https://doc.rust-lang.org/cargo/reference/source-replacement.html, https://doc.rust-lang.org/cargo/reference/registries.html.