From 0d4c7ec0721734bfa532007faaef9ca357eea371 Mon Sep 17 00:00:00 2001 From: Guanqun Lu Date: Tue, 17 Dec 2019 14:20:08 +0800 Subject: [PATCH] add a debug_assert according to the comment --- clippy_lints/src/methods/map_unwrap_or.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/clippy_lints/src/methods/map_unwrap_or.rs b/clippy_lints/src/methods/map_unwrap_or.rs index 7a19ac42e5ed..c90fba815e71 100644 --- a/clippy_lints/src/methods/map_unwrap_or.rs +++ b/clippy_lints/src/methods/map_unwrap_or.rs @@ -61,6 +61,7 @@ pub(super) fn lint<'a, 'tcx>( arg, suggest ) } else { + debug_assert!(is_result); "called `map(f).unwrap_or(a)` on a Result value. \ This can be done more directly by calling `map_or(a, f)` instead" .to_string()