From: boats Date: Thu, 5 Oct 2017 23:11:40 +0000 (+0000) Subject: Clean up X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~5^2~30^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2d11c7b536d1b8a82bbefe9ff3f37bebfc7742c5;p=cargo.git Clean up --- diff --git a/src/cargo/core/source/source_id.rs b/src/cargo/core/source/source_id.rs index 1c37d3199..6719b6ed9 100644 --- a/src/cargo/core/source/source_id.rs +++ b/src/cargo/core/source/source_id.rs @@ -186,23 +186,13 @@ impl SourceId { let registries = config.get_table("registries")?; match registries.as_ref().and_then(|registries| registries.val.get(key)) { Some(registry) => { - let index = match *registry { - CV::Table(ref registry, _) => { - match registry.get("index") { - Some(index) => index.string(&format!("registries.{}", key))?.0, - None => return Err(format!("No index for registry `{}`", key).into()), - } - } - _ => registry.expected("table", &format!("registries.{}", key))? - }; - - let url = index.to_url()?; + let index = config.get_str(&format!("registries.{}.index", key))?.to_url()?; Ok(SourceId { inner: Arc::new(SourceIdInner { kind: Kind::Registry, - canonical_url: git::canonicalize_url(&url)?, - url: url, + canonical_url: git::canonicalize_url(&index)?, + url: index, precise: None, }), })