blob: 8985d6db623dde21f4a79410912401156a96d88c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
error: needlessly owned Cow type
--> tests/ui/owned_cow.rs:8:25
|
LL | let x: Cow<'static, String> = Cow::Owned(String::from("Hi!"));
| ^^^^^^ help: use: `str`
|
= note: `-D clippy::owned-cow` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::owned_cow)]`
error: needlessly owned Cow type
--> tests/ui/owned_cow.rs:10:20
|
LL | let y: Cow<'_, Vec<u8>> = Cow::Owned(vec![]);
| ^^^^^^^ help: use: `[u8]`
error: needlessly owned Cow type
--> tests/ui/owned_cow.rs:12:20
|
LL | let z: Cow<'_, Vec<_>> = Cow::Owned(vec![2_i32]);
| ^^^^^^ help: use: `[_]`
error: needlessly owned Cow type
--> tests/ui/owned_cow.rs:14:20
|
LL | let o: Cow<'_, OsString> = Cow::Owned(OsString::new());
| ^^^^^^^^ help: use: `std::ffi::OsStr`
error: needlessly owned Cow type
--> tests/ui/owned_cow.rs:16:20
|
LL | let c: Cow<'_, CString> = Cow::Owned(CString::new("").unwrap());
| ^^^^^^^ help: use: `std::ffi::CStr`
error: needlessly owned Cow type
--> tests/ui/owned_cow.rs:18:20
|
LL | let p: Cow<'_, PathBuf> = Cow::Owned(PathBuf::new());
| ^^^^^^^ help: use: `std::path::Path`
error: aborting due to 6 previous errors
|