1 #![allow(clippy::redundant_clone)]
2 #![feature(custom_inner_attributes)]
3 #![clippy::msrv = "1.0.0"]
7 fn option_as_ref_deref() {
8 let mut opt = Some(String::from("123"));
10 let _ = opt.as_ref().map(String::as_str);
11 let _ = opt.as_ref().map(|x| x.as_str());
12 let _ = opt.as_mut().map(String::as_mut_str);
13 let _ = opt.as_mut().map(|x| x.as_mut_str());
16 fn match_like_matches() {
17 let _y = match Some(5) {
23 fn match_same_arms() {
26 (.., 3) => 42, //~ ERROR match arms have same body
31 fn match_same_arms2() {
32 let _ = match Some(42) {
34 None => 24, //~ ERROR match arms have same body
38 pub fn manual_strip_msrv() {
39 let s = "hello, world!";
40 if s.starts_with("hello, ") {
41 assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
46 option_as_ref_deref();
54 #![feature(custom_inner_attributes)]
55 #![clippy::msrv = "1.45.0"]
58 let s = "hello, world!";
59 if s.starts_with("hello, ") {
60 assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
66 #![feature(custom_inner_attributes)]
67 #![clippy::msrv = "1.46.0"]
70 let s = "hello, world!";
71 if s.starts_with("hello, ") {
72 assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
78 #![feature(custom_inner_attributes)]
79 #![clippy::msrv = "1.44.0"]
82 let s = "hello, world!";
83 if s.starts_with("hello, ") {
84 assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");