diff options
| author | tim <tdixon51793@gmail.com> | 2012-01-23 21:42:29 -0600 |
|---|---|---|
| committer | tim <tdixon51793@gmail.com> | 2012-01-23 21:42:29 -0600 |
| commit | 65840f3625482e2b8a860fce0c7c4da2669a9e22 (patch) | |
| tree | b9c6c02fa546019dd89e806fc633bd55913ead35 | |
| parent | dfae48736ffd3504598b15e0f350269a8d1b1063 (diff) | |
| download | rust-65840f3625482e2b8a860fce0c7c4da2669a9e22.tar.gz rust-65840f3625482e2b8a860fce0c7c4da2669a9e22.zip | |
Get `description` attribute for packages from json.
| -rw-r--r-- | src/cargo/cargo.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cargo/cargo.rs b/src/cargo/cargo.rs index 2edd205b783..27471cb1eaa 100644 --- a/src/cargo/cargo.rs +++ b/src/cargo/cargo.rs @@ -270,8 +270,15 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) { } _ { } } - // TODO: make this *actually* get the description from the .rc file. - let description = "This package's description."; + + let description = alt p.find("description") { + some(json::string(_n)) { _n } + _ { + warn("Malformed source json: " + src.name + " (missing description)"); + ret; + } + }; + vec::grow(src.packages, 1u, { // source: _source(src), name: name, |
