Function cargo_update::ops::get_index_url[][src]

pub fn get_index_url(
    crates_file: &Path,
    registry: &str
) -> Result<(String, Cow<'static, str>), Cow<'static, str>>
Expand description

Get the URL to update index from 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

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.