1 #![warn(clippy::collapsible_match)]
2 #![allow(clippy::needless_return, clippy::no_effect, clippy::single_match)]
4 fn lint_cases(opt_opt: Option<Option<u32>>, res_opt: Result<Option<u32>, String>) {
5 // if guards on outer match
8 Ok(val) if make() => match val {
15 Ok(val) => match val {
19 _ if make() => return,
27 ($outer:expr => $pat:pat, $e:expr => $inner_pat:pat, $then:expr) => {
37 // Lint this since the patterns are not defined by the macro.
38 // Allows the lint to work on if_chain! for example.
39 // Fixing the lint requires knowledge of the specific macro, but we optimistically assume that
40 // there is still a better way to write this.
41 mac!(res_opt => Ok(val), val => Some(n), foo(n));
44 // deref reference value
53 // ref pattern and deref
55 Some(ref s) => match &*s {
64 // deref inner value (cannot pattern match with Vec)
78 fn foo<T, U>(t: T) -> U {