-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor in prep of using diagnostic items/make using diagnostic items easier * changes from code review * add to_os_string and to_path_buf checks
- Loading branch information
Showing
5 changed files
with
115 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,52 @@ | ||
error: using `to_owned` on an already owned type | ||
--> $DIR/owned_to_owned.rs:33:20 | ||
error: `to_owned` called on a `Vec` | ||
--> $DIR/owned_to_owned.rs:59:17 | ||
| | ||
LL | let _ = result.to_owned(); | ||
| ^^^^^^^^ help: replace this with: `clone` | ||
LL | let _ = vec.to_owned(); | ||
| ^^^^^^^^ help: consider using: `clone` | ||
| | ||
= note: `-D clippy::owned-to-owned` implied by `-D warnings` | ||
|
||
error: using `to_vec` on an already owned type | ||
--> $DIR/owned_to_owned.rs:34:20 | ||
error: `to_vec` called on a `Vec` | ||
--> $DIR/owned_to_owned.rs:60:17 | ||
| | ||
LL | let _ = result.to_vec(); | ||
| ^^^^^^ help: replace this with: `clone` | ||
LL | let _ = vec.to_vec(); | ||
| ^^^^^^ help: consider using: `clone` | ||
|
||
error: using `to_owned` on an already owned type | ||
--> $DIR/owned_to_owned.rs:37:17 | ||
error: `to_owned` called on a `String` | ||
--> $DIR/owned_to_owned.rs:78:17 | ||
| | ||
LL | let _ = str.to_owned(); | ||
| ^^^^^^^^ help: replace this with: `clone` | ||
| ^^^^^^^^ help: consider using: `clone` | ||
|
||
error: using `to_owned` on an already owned type | ||
--> $DIR/owned_to_owned.rs:40:13 | ||
error: `to_owned` called on a `Kitten` | ||
--> $DIR/owned_to_owned.rs:82:20 | ||
| | ||
LL | let _ = kitten.to_owned(); | ||
| ^^^^^^^^^^^^^^^^^ help: replace this with: `kitten` | ||
| ^^^^^^^^ help: consider using: `clone` | ||
|
||
error: using `to_owned` on an already owned type | ||
--> $DIR/owned_to_owned.rs:47:21 | ||
error: `to_owned` called on a `PathBuf` | ||
--> $DIR/owned_to_owned.rs:90:21 | ||
| | ||
LL | let _ = pathbuf.to_owned(); | ||
| ^^^^^^^^ help: replace this with: `clone` | ||
| ^^^^^^^^ help: consider using: `clone` | ||
|
||
error: using `to_path_buf` on an already owned type | ||
--> $DIR/owned_to_owned.rs:48:21 | ||
error: `to_path_buf` called on a `PathBuf` | ||
--> $DIR/owned_to_owned.rs:91:21 | ||
| | ||
LL | let _ = pathbuf.to_path_buf(); | ||
| ^^^^^^^^^^^ help: replace this with: `clone` | ||
| ^^^^^^^^^^^ help: consider using: `clone` | ||
|
||
error: aborting due to 6 previous errors | ||
error: `to_owned` called on a `OsString` | ||
--> $DIR/owned_to_owned.rs:94:23 | ||
| | ||
LL | let _ = os_string.to_owned(); | ||
| ^^^^^^^^ help: consider using: `clone` | ||
|
||
error: `to_os_string` called on a `OsString` | ||
--> $DIR/owned_to_owned.rs:95:23 | ||
| | ||
LL | let _ = os_string.to_os_string(); | ||
| ^^^^^^^^^^^^ help: consider using: `clone` | ||
|
||
error: aborting due to 8 previous errors | ||
|