]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/unnecessary_owned_empty_strings.fixed
New upstream version 1.62.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / unnecessary_owned_empty_strings.fixed
1 // run-rustfix
2
3 #![warn(clippy::unnecessary_owned_empty_strings)]
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 }