]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unnecessary_owned_empty_strings.fixed
Auto merge of #102536 - scottmcm:lookup_line-tweak, r=jackh726
[rust.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     #[allow(clippy::manual_string_new)]
16     ref_str_argument("");
17
18     // should not be linted
19     ref_str_argument("");
20
21     // should not be linted
22     ref_string_argument(&String::new());
23 }