blob: b81759e1037b2c5a7d99643dc132e173dea9c28c [file] [log] [blame] [edit]
#![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
}