3 #![warn(clippy::manual_map)]
8 clippy::match_ref_pats,
19 Some(x) => Some(x + 1),
24 Some(x) => Some(x.is_empty()),
28 if let Some(x) = Some(0) {
36 Some(x) => { Some(std::convert::identity(x)) }
40 match Some(&String::new()) {
41 Some(x) => Some(str::len(x)),
46 Some(x) if false => Some(x + 1),
51 Some(x) => Some(x[0]),
56 &Some(x) => Some(x * 2),
60 match Some(String::new()) {
61 Some(ref x) => Some(x.is_empty()),
65 match &&Some(String::new()) {
66 Some(x) => Some(x.len()),
71 &&Some(x) => Some(x + x),
75 #[warn(clippy::option_map_unit_fn)]
76 match &mut Some(String::new()) {
77 Some(x) => Some(x.push_str("")),
81 #[allow(clippy::option_map_unit_fn)]
83 match &mut Some(String::new()) {
84 Some(x) => Some(x.push_str("")),
89 match &mut Some(String::new()) {
90 Some(ref x) => Some(x.len()),
94 match &mut &Some(String::new()) {
95 Some(x) => Some(x.is_empty()),
99 match Some((0, 1, 2)) {
100 Some((x, y, z)) => Some(x + y + z),
104 match Some([1, 2, 3]) {
105 Some([first, ..]) => Some(first),
109 match &Some((String::new(), "test")) {
110 Some((x, y)) => Some((y, x)),
114 match Some((String::new(), 0)) {
115 Some((ref x, y)) => Some((y, x)),
119 match Some(Some(0)) {
120 Some(Some(_)) | Some(None) => Some(0),
124 match Some(Some((0, 1))) {
125 Some(Some((x, 1))) => Some(x),
130 fn f1() -> Result<(), ()> {
131 let _ = match Some(Ok(())) {
138 for &x in Some(Some(true)).iter() {
140 Some(x) => Some(if x { continue } else { x }),
146 let x1 = (Some(String::new()), 0);
149 Some(x) => Some((x, x1.1)),
158 fn f(self) -> Option<(String, u32)> {
160 Some(x) => Some((x, self.y)),
168 Some(x) => Some(vec![x]),
172 match option_env!("") {
173 Some(x) => Some(String::from(x)),