File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -521,20 +521,18 @@ mod decl {
521521 let default = args. take_keyword ( "default" ) ;
522522 let mut key_func = args. take_keyword ( "key" ) ;
523523
524- match args. check_kwargs_empty ( vm) {
525- Some ( err) => return Err ( err) ,
526- None => { }
524+ if let Some ( err) = args. check_kwargs_empty ( vm) {
525+ return Err ( err) ;
527526 }
528527
529- if !default_allowed && default. is_some ( ) {
528+ if default. is_some ( ) && !default_allowed {
530529 return Err ( vm. new_type_error (
531530 "Specifying default not allowed with more than 1 argument" . to_owned ( ) ,
532531 ) ) ;
533532 }
534533
535534 if candidates. is_empty ( ) {
536- return default
537- . ok_or_else ( || vm. new_value_error ( "min() arg is an empty sequence" . to_owned ( ) ) ) ;
535+ return default. ok_or_else ( || vm. new_value_error ( "min() arg is an empty sequence" . to_owned ( ) ) ) ;
538536 }
539537
540538 if let Some ( ref obj) = key_func {
Original file line number Diff line number Diff line change @@ -197,9 +197,8 @@ impl FuncArgs {
197197 given_args,
198198 ) ) )
199199 } else {
200- match self . check_kwargs_empty ( vm) {
201- Some ( err) => return Err ( err) ,
202- None => { }
200+ if let Some ( err) = self . check_kwargs_empty ( vm) {
201+ return Err ( err) ;
203202 }
204203 Ok ( bound)
205204 }
Original file line number Diff line number Diff line change 77
88// for methods like vm.to_str(), not the typical use of 'to' as a method prefix
99#![ allow( clippy:: wrong_self_convention, clippy:: implicit_hasher) ]
10+ // clippy warns on this for macro generated code rust-clippy/issues/6249
11+ #![ allow( clippy:: suspicious_else_formatting) ]
1012// to allow `mod foo {}` in foo.rs; clippy thinks this is a mistake/misunderstanding of
1113// how `mod` works, but we want this sometimes for pymodule declarations
1214#![ allow( clippy:: module_inception) ]
You can’t perform that action at this time.
0 commit comments