Skip to content

Commit 0d4c7ec

Browse files
author
Guanqun Lu
committed
add a debug_assert according to the comment
1 parent b55ead5 commit 0d4c7ec

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clippy_lints/src/methods/map_unwrap_or.rs

+1
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)