4 #![warn(clippy::manual_map)]
9 clippy::match_ref_pats,
20 Some(x) => Some(x + 1),
25 Some(x) => Some(x.is_empty()),
29 if let Some(x) = Some(0) {
37 Some(x) => { Some(std::convert::identity(x)) }
41 match Some(&String::new()) {
42 Some(x) => Some(str::len(x)),
47 Some(x) if false => Some(x + 1),
52 Some(x) => Some(x[0]),
57 &Some(x) => Some(x * 2),
61 match Some(String::new()) {
62 Some(ref x) => Some(x.is_empty()),
66 match &&Some(String::new()) {
67 Some(x) => Some(x.len()),
72 &&Some(x) => Some(x + x),
76 #[warn(clippy::option_map_unit_fn)]
77 match &mut Some(String::new()) {
78 Some(x) => Some(x.push_str("")),
82 #[allow(clippy::option_map_unit_fn)]
84 match &mut Some(String::new()) {
85 Some(x) => Some(x.push_str("")),
90 match &mut Some(String::new()) {
91 Some(ref x) => Some(x.len()),
95 match &mut &Some(String::new()) {
96 Some(x) => Some(x.is_empty()),
100 match Some((0, 1, 2)) {
101 Some((x, y, z)) => Some(x + y + z),
105 match Some([1, 2, 3]) {
106 Some([first, ..]) => Some(first),
110 match &Some((String::new(), "test")) {
111 Some((x, y)) => Some((y, x)),
115 match Some((String::new(), 0)) {
116 Some((ref x, y)) => Some((y, x)),
120 match Some(Some(0)) {
121 Some(Some(_)) | Some(None) => Some(0),
125 match Some(Some((0, 1))) {
126 Some(Some((x, 1))) => Some(x),
131 fn f1() -> Result<(), ()> {
132 let _ = match Some(Ok(())) {
139 for &x in Some(Some(true)).iter() {
141 Some(x) => Some(if x { continue } else { x }),
147 let x1 = (Some(String::new()), 0);
150 Some(x) => Some((x, x1.1)),
159 fn f(self) -> Option<(String, u32)> {
161 Some(x) => Some((x, self.y)),
169 Some(x) => Some(vec![x]),
173 match option_env!("") {
174 Some(x) => Some(String::from(x)),
179 async fn f2(x: u32) -> u32 {
185 Some(x) => Some(f2(x).await),
191 if let Some(_) = Some(0) {
193 } else if let Some(x) = Some(0) {