File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
src/cargo/sources/registry Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,14 @@ pub struct NewCrateDependency {
7777 pub artifact : Option < Vec < String > > ,
7878 #[ serde( skip_serializing_if = "Option::is_none" ) ]
7979 pub bindep_target : Option < String > ,
80- #[ serde( default ) ]
80+ #[ serde( default , skip_serializing_if = "is_false" ) ]
8181 pub lib : bool ,
8282}
8383
84+ fn is_false ( & x: & bool ) -> bool {
85+ !x
86+ }
87+
8488#[ derive( Deserialize ) ]
8589pub struct User {
8690 pub id : u32 ,
Original file line number Diff line number Diff line change @@ -365,6 +365,7 @@ struct RegistryDependency<'a> {
365365 public : Option < bool > ,
366366 artifact : Option < Vec < Cow < ' a , str > > > ,
367367 bindep_target : Option < Cow < ' a , str > > ,
368+ #[ serde( default ) ]
368369 lib : bool ,
369370}
370371
Original file line number Diff line number Diff line change @@ -1926,15 +1926,25 @@ You may press ctrl-c [..]
19261926 "badges": {},
19271927 "categories": [],
19281928 "deps": [{
1929+ "artifact": [
1930+ "bin"
1931+ ],
19291932 "default_features": true,
19301933 "features": [],
19311934 "kind": "normal",
1935+ "lib": true,
19321936 "name": "bar",
19331937 "optional": false,
19341938 "target": null,
19351939 "version_req": "^1.0"
19361940 },
19371941 {
1942+ "artifact": [
1943+ "bin:a",
1944+ "cdylib",
1945+ "staticlib"
1946+ ],
1947+ "bindep_target": "target",
19381948 "default_features": true,
19391949 "features": [],
19401950 "kind": "build",
You can’t perform that action at this time.
0 commit comments