From 4d53519606cfc411a031f1c8c374315fd5ad2961 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 22 May 2018 16:55:53 -0700 Subject: [PATCH] Cleanup, address some comments. --- src/cargo/util/config.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cargo/util/config.rs b/src/cargo/util/config.rs index 47625aebe..9a6cfea5e 100644 --- a/src/cargo/util/config.rs +++ b/src/cargo/util/config.rs @@ -246,7 +246,6 @@ impl Config { .map(AsRef::as_ref) } - // TODO: Why is this `pub`? pub fn values(&self) -> CargoResult<&HashMap> { self.values.try_borrow_with(|| self.load_values()) } @@ -508,8 +507,7 @@ impl Config { } } - // TODO: why is this pub? - pub fn expected(&self, ty: &str, key: &str, val: CV) -> CargoResult { + fn expected(&self, ty: &str, key: &str, val: CV) -> CargoResult { val.expected(ty, key) .map_err(|e| format_err!("invalid configuration for key `{}`\n{}", key, e)) } @@ -591,7 +589,6 @@ impl Config { !self.frozen && !self.locked } - // TODO: this was pub for RLS but may not be needed anymore? /// Loads configuration from the filesystem pub fn load_values(&self) -> CargoResult> { let mut cfg = CV::Table(HashMap::new(), PathBuf::from(".")); @@ -1195,8 +1192,6 @@ impl<'de, 'config> de::MapAccess<'de> for ConfigMapAccess<'config> { where V: de::DeserializeSeed<'de>, { - // TODO: Is it safe to assume next_value_seed is always called - // (exactly once) after next_key_seed? let next_key = self.next.take().expect("next field missing"); let next_key = self.key.join(next_key); seed.deserialize(Deserializer { @@ -1490,7 +1485,7 @@ impl ConfigValue { } } - pub fn expected(&self, wanted: &str, key: &str) -> CargoResult { + fn expected(&self, wanted: &str, key: &str) -> CargoResult { bail!( "expected a {}, but found a {} for `{}` in {}", wanted, -- 2.30.2