]> git.lizzy.rs Git - rust.git/blob - tests/ui/unnecessary_owned_empty_string.fixed
unnecessary_string_new
[rust.git] / tests / ui / unnecessary_owned_empty_string.fixed
1 // run-rustfix
2
3 #![warn(clippy::unnecessary_owned_empty_string)]
4
5 fn ref_str_argument(_value: &str) {}
6
7 #[allow(clippy::ptr_arg)]
8 fn ref_string_argument(_value: &String) {}
9
10 fn main() {
11     // should be linted
12     ref_str_argument("");
13
14     // should be linted
15     ref_str_argument("");
16
17     // should not be linted
18     ref_str_argument("");
19
20     // should not be linted
21     ref_string_argument(&String::new());
22 }