From 2d11c7b536d1b8a82bbefe9ff3f37bebfc7742c5 Mon Sep 17 00:00:00 2001 From: boats Date: Thu, 5 Oct 2017 23:11:40 +0000 Subject: [PATCH] Clean up --- src/cargo/core/source/source_id.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) 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, }), }) -- 2.30.2