File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -177,16 +177,7 @@ impl NewVersion {
177
177
178
178
fn validate_license ( & mut self , license_file : Option < & str > ) -> AppResult < ( ) > {
179
179
if let Some ( ref license) = self . license {
180
- for part in license. split ( '/' ) {
181
- license_exprs:: validate_license_expr ( part) . map_err ( |e| {
182
- cargo_err ( & format_args ! (
183
- "{}; see http://opensource.org/licenses \
184
- for options, and http://spdx.org/licenses/ \
185
- for their identifiers",
186
- e
187
- ) )
188
- } ) ?;
189
- }
180
+ validate_license_expr ( license) ?;
190
181
} else if license_file. is_some ( ) {
191
182
// If no license is given, but a license file is given, flag this
192
183
// crate as having a nonstandard license. Note that we don't
@@ -197,6 +188,16 @@ impl NewVersion {
197
188
}
198
189
}
199
190
191
+ fn validate_license_expr ( s : & str ) -> AppResult < ( ) > {
192
+ for part in s. split ( '/' ) {
193
+ license_exprs:: validate_license_expr ( part) . map_err ( |e| {
194
+ cargo_err ( & format_args ! ( "{}; see http://opensource.org/licenses for options, and http://spdx.org/licenses/ for their identifiers" , e) )
195
+ } ) ?;
196
+ }
197
+
198
+ Ok ( ( ) )
199
+ }
200
+
200
201
#[ cfg( test) ]
201
202
mod tests {
202
203
use super :: TopVersions ;
You can’t perform that action at this time.
0 commit comments