Skip to content

Commit ad339b1

Browse files
committed
Skip yanked crates when building world
So we can build world in a old fashion way in case of emergency (Ref: #76)
1 parent 1dbc521 commit ad339b1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/docbuilder/crates.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ fn crates_from_file<F>(path: &PathBuf, func: &mut F) -> Result<()>
3636
.and_then(|n| n.as_string())
3737
.ok_or("`vers` not found in JSON object"));
3838

39+
let yanked = try!(obj.get("yanked")
40+
.and_then(|n| n.as_boolean())
41+
.ok_or("`vers` not found in JSON object"));
42+
43+
// Skip yanked crates
44+
if yanked {
45+
continue;
46+
}
47+
3948
name.clear();
4049
name.push_str(crate_name);
4150
versions.push(format!("{}", vers));

0 commit comments

Comments
 (0)