@@ -26,7 +26,9 @@ struct CrateMeta { total: i32 }
26
26
#[ derive( RustcDecodable ) ]
27
27
struct GitCrate { name : String , vers : String , deps : Vec < String > , cksum : String }
28
28
#[ derive( RustcDecodable ) ]
29
- struct GoodCrate { krate : EncodableCrate , warnings : Vec < String > }
29
+ struct Warnings { invalid_categories : Vec < String > }
30
+ #[ derive( RustcDecodable ) ]
31
+ struct GoodCrate { krate : EncodableCrate , warnings : Warnings }
30
32
#[ derive( RustcDecodable ) ]
31
33
struct CrateResponse { krate : EncodableCrate , versions : Vec < EncodableVersion > , keywords : Vec < EncodableKeyword > }
32
34
#[ derive( RustcDecodable ) ]
@@ -896,7 +898,7 @@ fn good_categories() {
896
898
let json: GoodCrate = :: json ( & mut response) ;
897
899
assert_eq ! ( json. krate. name, "foo" ) ;
898
900
assert_eq ! ( json. krate. max_version, "1.0.0" ) ;
899
- assert_eq ! ( json. warnings. len( ) , 0 ) ;
901
+ assert_eq ! ( json. warnings. invalid_categories . len( ) , 0 ) ;
900
902
}
901
903
902
904
#[ test]
@@ -910,8 +912,7 @@ fn ignored_categories() {
910
912
let json: GoodCrate = :: json ( & mut response) ;
911
913
assert_eq ! ( json. krate. name, "foo" ) ;
912
914
assert_eq ! ( json. krate. max_version, "1.0.0" ) ;
913
- assert_eq ! ( json. warnings, vec![ "\' bar\' is not a recognized category name \
914
- and has been ignored.". to_string( ) ] ) ;
915
+ assert_eq ! ( json. warnings. invalid_categories, vec![ "bar" . to_string( ) ] ) ;
915
916
}
916
917
917
918
#[ test]
0 commit comments