Skip to content

Commit 3a45839

Browse files
committed
Supress clippy lint that doesn't work
1 parent 1aa603a commit 3a45839

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

vm/src/builtins/make_module.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff 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 {

vm/src/function.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

vm/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
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)]

0 commit comments

Comments
 (0)