From: Eric Huss Date: Tue, 22 May 2018 23:55:53 +0000 (-0700) Subject: Cleanup, address some comments. X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2^2~11^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4d53519606cfc411a031f1c8c374315fd5ad2961;p=cargo.git Cleanup, address some comments. --- 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,