4 #![warn(clippy::manual_map)]
9 clippy::match_ref_pats,
10 clippy::redundant_pattern_matching,
21 Some(x) => Some(x + 1),
26 Some(x) => Some(x.is_empty()),
30 if let Some(x) = Some(0) {
38 Some(x) => { Some(std::convert::identity(x)) }
42 match Some(&String::new()) {
43 Some(x) => Some(str::len(x)),
48 Some(x) if false => Some(x + 1),
53 Some(x) => Some(x[0]),
58 &Some(x) => Some(x * 2),
62 match Some(String::new()) {
63 Some(ref x) => Some(x.is_empty()),
67 match &&Some(String::new()) {
68 Some(x) => Some(x.len()),
73 &&Some(x) => Some(x + x),
77 #[warn(clippy::option_map_unit_fn)]
78 match &mut Some(String::new()) {
79 Some(x) => Some(x.push_str("")),
83 #[allow(clippy::option_map_unit_fn)]
85 match &mut Some(String::new()) {
86 Some(x) => Some(x.push_str("")),
91 match &mut Some(String::new()) {
92 Some(ref x) => Some(x.len()),
96 match &mut &Some(String::new()) {
97 Some(x) => Some(x.is_empty()),
101 match Some((0, 1, 2)) {
102 Some((x, y, z)) => Some(x + y + z),
106 match Some([1, 2, 3]) {
107 Some([first, ..]) => Some(first),
111 match &Some((String::new(), "test")) {
112 Some((x, y)) => Some((y, x)),
116 match Some((String::new(), 0)) {
117 Some((ref x, y)) => Some((y, x)),
121 match Some(Some(0)) {
122 Some(Some(_)) | Some(None) => Some(0),
126 match Some(Some((0, 1))) {
127 Some(Some((x, 1))) => Some(x),
132 fn f1() -> Result<(), ()> {
133 let _ = match Some(Ok(())) {
140 for &x in Some(Some(true)).iter() {
142 Some(x) => Some(if x { continue } else { x }),
148 let x1 = (Some(String::new()), 0);
151 Some(x) => Some((x, x1.1)),
160 fn f(self) -> Option<(String, u32)> {
162 Some(x) => Some((x, self.y)),
170 Some(x) => Some(vec![x]),
174 match option_env!("") {
175 Some(x) => Some(String::from(x)),
180 async fn f2(x: u32) -> u32 {
186 Some(x) => Some(f2(x).await),
192 if let Some(_) = Some(0) {
194 } else if let Some(x) = Some(0) {
202 } else if let Some(x) = Some(0) {
211 Some(x) => Some(x + 1),
217 let s = &String::new();
218 let _: Option<&str> = match Some(s) {