File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ impl HirLintPass for NeedlessOperation {
161
161
buffer : & mut Vec < Lint > ,
162
162
_compilation : Compilation ,
163
163
) {
164
- if decl. kind == CallableKind :: Operation {
164
+ if decl. kind == CallableKind :: Operation && & * decl . name . name != "<lambda>" {
165
165
let mut op_limits = IsQuantumOperation :: default ( ) ;
166
166
167
167
op_limits. visit_callable_decl ( decl) ;
Original file line number Diff line number Diff line change @@ -433,19 +433,11 @@ fn redundant_semicolons() {
433
433
}
434
434
435
435
#[ test]
436
- fn needless_operation_lambda_operations ( ) {
436
+ fn needless_operation_no_lint_for_lambda_operations ( ) {
437
437
check (
438
438
& wrap_in_callable ( "let a = (a) => a + 1;" , CallableKind :: Function ) ,
439
439
& expect ! [ [ r#"
440
- [
441
- SrcLint {
442
- source: "(a) => a + 1",
443
- level: Allow,
444
- message: "operation does not contain any quantum operations",
445
- help: "this callable can be declared as a function instead",
446
- code_action_edits: [],
447
- },
448
- ]
440
+ []
449
441
"# ] ] ,
450
442
) ;
451
443
}
@@ -557,6 +549,7 @@ fn needless_operation_partial_application() {
557
549
"# ] ] ,
558
550
) ;
559
551
}
552
+
560
553
#[ test]
561
554
fn deprecated_newtype_usage ( ) {
562
555
check (
You can’t perform that action at this time.
0 commit comments