-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yusuf Raji
committed
Jan 21, 2025
1 parent
009f955
commit 609541b
Showing
2 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
error: mapping over single function argument of `Option<T>`, to return `Option<T>`, can be best expressed by applying the map outside of the function. | ||
error: `fn` that only maps over argument | ||
--> tests/ui/single_option_map.rs:3:1 | ||
| | ||
LL | / fn h(arg: Option<u32>) -> Option<u32> { | ||
LL | | arg.map(|x| x * 2) | ||
LL | | } | ||
| |_^ | ||
| | ||
= help: move the `.map` to the caller or to an `_opt` function | ||
= note: `-D clippy::single-option-map` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::single_option_map)]` | ||
|
||
error: mapping over single function argument of `Option<T>`, to return `Option<T>`, can be best expressed by applying the map outside of the function. | ||
error: `fn` that only maps over argument | ||
--> tests/ui/single_option_map.rs:7:1 | ||
| | ||
LL | / fn j(arg: Option<u64>) -> Option<u64> { | ||
LL | | arg.map(|x| x * 2) | ||
LL | | } | ||
| |_^ | ||
| | ||
= help: move the `.map` to the caller or to an `_opt` function | ||
|
||
error: aborting due to 2 previous errors | ||
|