Skip to content

Commit 65840f3

Browse files
author
tim
committed
Get description attribute for packages from json.
1 parent dfae487 commit 65840f3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/cargo/cargo.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,15 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) {
270270
}
271271
_ { }
272272
}
273-
// TODO: make this *actually* get the description from the .rc file.
274-
let description = "This package's description.";
273+
274+
let description = alt p.find("description") {
275+
some(json::string(_n)) { _n }
276+
_ {
277+
warn("Malformed source json: " + src.name + " (missing description)");
278+
ret;
279+
}
280+
};
281+
275282
vec::grow(src.packages, 1u, {
276283
// source: _source(src),
277284
name: name,

0 commit comments

Comments
 (0)