1 #![allow(clippy::redundant_clone)]
2 #![warn(clippy::manual_non_exhaustive)]
14 // user forgot to remove the marker
24 fn option_as_ref_deref() {
25 let mut opt = Some(String::from("123"));
27 let _ = opt.as_ref().map(String::as_str);
28 let _ = opt.as_ref().map(|x| x.as_str());
29 let _ = opt.as_mut().map(String::as_mut_str);
30 let _ = opt.as_mut().map(|x| x.as_mut_str());
33 fn match_like_matches() {
34 let _y = match Some(5) {
40 fn match_same_arms() {
43 (.., 3) => 42, //~ ERROR match arms have same body
48 fn match_same_arms2() {
49 let _ = match Some(42) {
51 None => 24, //~ ERROR match arms have same body
55 fn manual_strip_msrv() {
56 let s = "hello, world!";
57 if s.starts_with("hello, ") {
58 assert_eq!(s["hello, ".len()..].to_uppercase(), "WORLD!");
63 option_as_ref_deref();