| #![warn(clippy::str_to_string)] | |
| fn main() { | |
| let hello = "hello world".to_string(); | |
| //~^ str_to_string | |
| let msg = &hello[..]; | |
| msg.to_string(); | |
| //~^ str_to_string | |
| } | |
| fn issue16271(key: &[u8]) { | |
| macro_rules! t { | |
| ($e:expr) => { | |
| match $e { | |
| Ok(e) => e, | |
| Err(e) => panic!("{} failed with {}", stringify!($e), e), | |
| } | |
| }; | |
| } | |
| let _value = t!(str::from_utf8(key)).to_string(); | |
| //~^ str_to_string | |
| } |