Skip to content

Commit cd1f64c

Browse files
committed
refactor(gctx): remove visitor methods that is never called
It never worked because our custom `Deserializer::deserialize_option` never called `visit_str`. See https://github.com/rust-lang/cargo/blob/c369b8c8d85a/src/cargo/util/config/de.rs#L135-L145
1 parent 42933db commit cd1f64c

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/cargo/util/context/schema.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -398,27 +398,7 @@ where
398398
type Value = Option<ProgressConfig>;
399399

400400
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
401-
formatter.write_str("a string (\"auto\" or \"never\") or a table")
402-
}
403-
404-
fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
405-
where
406-
E: serde::de::Error,
407-
{
408-
match s {
409-
"auto" => Ok(Some(ProgressConfig {
410-
when: ProgressWhen::Auto,
411-
width: None,
412-
term_integration: None,
413-
})),
414-
"never" => Ok(Some(ProgressConfig {
415-
when: ProgressWhen::Never,
416-
width: None,
417-
term_integration: None,
418-
})),
419-
"always" => Err(E::custom("\"always\" progress requires a `width` key")),
420-
_ => Err(E::unknown_variant(s, &["auto", "never"])),
421-
}
401+
formatter.write_str("a table")
422402
}
423403

424404
fn visit_none<E>(self) -> Result<Self::Value, E>

0 commit comments

Comments
 (0)