File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -151,13 +151,13 @@ fn transmit(config: &Config,
151
151
} , tarball) ;
152
152
153
153
match publish {
154
- Ok ( invalid_categories ) => {
155
- if !invalid_categories. is_empty ( ) {
154
+ Ok ( warnings ) => {
155
+ if !warnings . invalid_categories . is_empty ( ) {
156
156
let msg = format ! ( "\
157
157
the following are not valid category slugs and were \
158
158
ignored: {}. Please see https://crates.io/category_slugs \
159
159
for the list of all category slugs. \
160
- ", invalid_categories. join( ", " ) ) ;
160
+ ", warnings . invalid_categories. join( ", " ) ) ;
161
161
config. shell ( ) . warn ( & msg) ?;
162
162
}
163
163
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -111,6 +111,10 @@ pub struct User {
111
111
pub name : Option < String > ,
112
112
}
113
113
114
+ pub struct Warnings {
115
+ pub invalid_categories : Vec < String > ,
116
+ }
117
+
114
118
#[ derive( RustcDecodable ) ] struct R { ok : bool }
115
119
#[ derive( RustcDecodable ) ] struct ApiErrorList { errors : Vec < ApiError > }
116
120
#[ derive( RustcDecodable ) ] struct ApiError { detail : String }
@@ -155,7 +159,7 @@ impl Registry {
155
159
}
156
160
157
161
pub fn publish ( & mut self , krate : & NewCrate , tarball : & File )
158
- -> Result < Vec < String > > {
162
+ -> Result < Warnings > {
159
163
let json = json:: encode ( krate) ?;
160
164
// Prepare the body. The format of the upload request is:
161
165
//
@@ -215,7 +219,7 @@ impl Registry {
215
219
x. iter ( ) . flat_map ( Json :: as_string) . map ( Into :: into) . collect ( )
216
220
} )
217
221
. unwrap_or_else ( Vec :: new) ;
218
- Ok ( invalid_categories)
222
+ Ok ( Warnings { invalid_categories : invalid_categories } )
219
223
}
220
224
221
225
pub fn search ( & mut self , query : & str , limit : u8 ) -> Result < ( Vec < Crate > , u32 ) > {
You can’t perform that action at this time.
0 commit comments