Skip to content

Commit 81db440

Browse files
committed
Rename krate in json to crate
This was changed when switching from rustc serialize to serde; ember expects the key in the JSON to be "crate" but Rust needs the field in the struct to be named "krate". The tests didn't catch this because we aren't testing the serialized JSON string at all; a round trip through JSON totally worked :-/
1 parent 65780b2 commit 81db440

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/version.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub struct NewVersion {
5151
#[derive(Serialize, Deserialize, Debug)]
5252
pub struct EncodableVersion {
5353
pub id: i32,
54+
#[serde(rename = "crate")]
5455
pub krate: String,
5556
pub num: String,
5657
pub dl_path: String,

0 commit comments

Comments
 (0)