Skip to content

Commit e66c413

Browse files
committed
Support untyped warnings from crates.io with successful publish
1 parent ab59c81 commit e66c413

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/cargo/ops/registry.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ fn transmit(
276276
config.shell().warn(&msg)?;
277277
}
278278

279+
if !warnings.other.is_empty() {
280+
for msg in warnings.other {
281+
config.shell().warn(&msg)?;
282+
}
283+
}
284+
279285
Ok(())
280286
}
281287
Err(e) => Err(e),

src/crates-io/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ pub struct User {
8686
pub struct Warnings {
8787
pub invalid_categories: Vec<String>,
8888
pub invalid_badges: Vec<String>,
89+
pub other: Vec<String>,
8990
}
9091

9192
#[derive(Deserialize)]
@@ -223,9 +224,17 @@ impl Registry {
223224
.map(|x| x.iter().flat_map(|j| j.as_str()).map(Into::into).collect())
224225
.unwrap_or_else(Vec::new);
225226

227+
let other: Vec<String> = response
228+
.get("warnings")
229+
.and_then(|j| j.get("other"))
230+
.and_then(|j| j.as_array())
231+
.map(|x| x.iter().flat_map(|j| j.as_str()).map(Into::into).collect())
232+
.unwrap_or_else(Vec::new);
233+
226234
Ok(Warnings {
227235
invalid_categories,
228236
invalid_badges,
237+
other,
229238
})
230239
}
231240

0 commit comments

Comments
 (0)