3 #![warn(clippy::manual_map)]
4 #![allow(clippy::no_effect, clippy::map_identity, clippy::unit_arg, clippy::match_ref_pats)]
13 Some(x) => Some(x + 1),
18 Some(x) => Some(x.is_empty()),
22 if let Some(x) = Some(0) {
30 Some(x) => { Some(std::convert::identity(x)) }
34 match Some(&String::new()) {
35 Some(x) => Some(str::len(x)),
40 Some(x) if false => Some(x + 1),
45 Some(x) => Some(x[0]),
50 &Some(x) => Some(x * 2),
54 match Some(String::new()) {
55 Some(ref x) => Some(x.is_empty()),
59 match &&Some(String::new()) {
60 Some(x) => Some(x.len()),
65 &&Some(x) => Some(x + x),
69 #[warn(clippy::option_map_unit_fn)]
70 match &mut Some(String::new()) {
71 Some(x) => Some(x.push_str("")),
75 #[allow(clippy::option_map_unit_fn)]
77 match &mut Some(String::new()) {
78 Some(x) => Some(x.push_str("")),
83 match &mut Some(String::new()) {
84 Some(ref x) => Some(x.len()),
88 match &mut &Some(String::new()) {
89 Some(x) => Some(x.is_empty()),
93 match Some((0, 1, 2)) {
94 Some((x, y, z)) => Some(x + y + z),
98 match Some([1, 2, 3]) {
99 Some([first, ..]) => Some(first),
103 match &Some((String::new(), "test")) {
104 Some((x, y)) => Some((y, x)),
108 match Some((String::new(), 0)) {
109 Some((ref x, y)) => Some((y, x)),
113 match Some(Some(0)) {
114 Some(Some(_)) | Some(None) => Some(0),
118 match Some(Some((0, 1))) {
119 Some(Some((x, 1))) => Some(x),