Skip to content

Commit cf1e28e

Browse files
author
Guanqun Lu
committed
add a debug_assert according to the comment
1 parent 720578d commit cf1e28e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clippy_lints/src/methods/map_unwrap_or.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub(super) fn lint<'a, 'tcx>(
6161
arg, suggest
6262
)
6363
} else {
64+
debug_assert!(is_result);
6465
"called `map(f).unwrap_or(a)` on a Result value. \
6566
This can be done more directly by calling `map_or(a, f)` instead"
6667
.to_string()

0 commit comments

Comments
 (0)