fix: fix ci errors

This commit is contained in:
Yuxiang Qiu 2024-04-01 16:59:46 -04:00
parent e36c7d55b6
commit b89fa5364f
No known key found for this signature in database
2 changed files with 13 additions and 13 deletions

View file

@ -36,7 +36,7 @@ pub(super) fn check<'tcx>(
// suggest `any(|..| *..)` instead of `any(|..| **..)` for `find(|..| **..).is_some()`
let mut applicability = Applicability::MachineApplicable;
let any_search_snippet = if search_method == "find"
&& let hir::ExprKind::Closure(&hir::Closure { body, .. }) = search_arg.kind
&& let ExprKind::Closure(&hir::Closure { body, .. }) = search_arg.kind
&& let closure_body = cx.tcx.hir().body(body)
&& let Some(closure_arg) = closure_body.params.first()
{

View file

@ -283,73 +283,73 @@ LL | let _ = v.iter().find(|fp| test_u32_2(*fp.field)).is_none();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!v.iter().any(|fp| test_u32_2(*fp.field))`
error: called `is_none()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_none.rs:235:17
--> tests/ui/search_is_some_fixable_none.rs:235:17
|
LL | let _ = v.iter().find(|x| **x == 42).is_none();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!v.iter().any(|x| *x == 42)`
error: called `is_none()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_none.rs:236:17
--> tests/ui/search_is_some_fixable_none.rs:236:17
|
LL | Foo.bar(v.iter().find(|x| **x == 42).is_none());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!v.iter().any(|x| *x == 42)`
error: called `is_none()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_none.rs:241:9
--> tests/ui/search_is_some_fixable_none.rs:241:9
|
LL | v.iter().find(|x| **x == 42).is_none().then(computations);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(!v.iter().any(|x| *x == 42))`
error: called `is_none()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_none.rs:246:9
--> tests/ui/search_is_some_fixable_none.rs:246:9
|
LL | v.iter().find(|x| **x == 42).is_none().then_some(0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(!v.iter().any(|x| *x == 42))`
error: called `is_none()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_none.rs:251:17
--> tests/ui/search_is_some_fixable_none.rs:251:17
|
LL | let _ = s.find("world").is_none();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!s.contains("world")`
error: called `is_none()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_none.rs:252:17
--> tests/ui/search_is_some_fixable_none.rs:252:17
|
LL | Foo.bar(s.find("world").is_none());
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!s.contains("world")`
error: called `is_none()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_none.rs:254:17
--> tests/ui/search_is_some_fixable_none.rs:254:17
|
LL | let _ = s.find("world").is_none();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!s.contains("world")`
error: called `is_none()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_none.rs:255:17
--> tests/ui/search_is_some_fixable_none.rs:255:17
|
LL | Foo.bar(s.find("world").is_none());
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!s.contains("world")`
error: called `is_none()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_none.rs:260:17
--> tests/ui/search_is_some_fixable_none.rs:260:17
|
LL | let _ = s.find("world").is_none().then(computations);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(!s.contains("world"))`
error: called `is_none()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_none.rs:262:17
--> tests/ui/search_is_some_fixable_none.rs:262:17
|
LL | let _ = s.find("world").is_none().then(computations);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(!s.contains("world"))`
error: called `is_none()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_none.rs:267:17
--> tests/ui/search_is_some_fixable_none.rs:267:17
|
LL | let _ = s.find("world").is_none().then_some(0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(!s.contains("world"))`
error: called `is_none()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_none.rs:269:17
--> tests/ui/search_is_some_fixable_none.rs:269:17
|
LL | let _ = s.find("world").is_none().then_some(0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(!s.contains("world"))`