blob: 8713c4f9bc8636e2aa283d80830bd6b68ea67a5b [file] [log] [blame] [edit]
#![warn(clippy::str_to_string)]
fn main() {
let hello = "hello world".to_owned();
//~^ str_to_string
let msg = &hello[..];
msg.to_owned();
//~^ 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_owned();
//~^ str_to_string
}