diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs index 3932abdbece..2993fb7060d 100644 --- a/src/cargo/ops/registry.rs +++ b/src/cargo/ops/registry.rs @@ -276,6 +276,12 @@ fn transmit( config.shell().warn(&msg)?; } + if !warnings.other.is_empty() { + for msg in warnings.other { + config.shell().warn(&msg)?; + } + } + Ok(()) } Err(e) => Err(e), diff --git a/src/crates-io/lib.rs b/src/crates-io/lib.rs index 6de2f30533a..65843e7dcca 100644 --- a/src/crates-io/lib.rs +++ b/src/crates-io/lib.rs @@ -86,6 +86,7 @@ pub struct User { pub struct Warnings { pub invalid_categories: Vec, pub invalid_badges: Vec, + pub other: Vec, } #[derive(Deserialize)] @@ -223,9 +224,17 @@ impl Registry { .map(|x| x.iter().flat_map(|j| j.as_str()).map(Into::into).collect()) .unwrap_or_else(Vec::new); + let other: Vec = response + .get("warnings") + .and_then(|j| j.get("other")) + .and_then(|j| j.as_array()) + .map(|x| x.iter().flat_map(|j| j.as_str()).map(Into::into).collect()) + .unwrap_or_else(Vec::new); + Ok(Warnings { invalid_categories, invalid_badges, + other, }) }