Skip to content

Commit

Permalink
[Clippy] Swap redundant_clone to use diagnostic items instead of paths
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Sep 19, 2024
1 parent 3310a0b commit a61b7b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions std/src/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,7 @@ impl OsStr {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
#[cfg_attr(not(test), rustc_diagnostic_item = "os_str_to_os_string")]
pub fn to_os_string(&self) -> OsString {
OsString { inner: self.inner.to_owned() }
}
Expand Down
1 change: 1 addition & 0 deletions std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,7 @@ impl Path {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "path_to_pathbuf")]
pub fn to_path_buf(&self) -> PathBuf {
PathBuf::from(self.inner.to_os_string())
}
Expand Down

0 comments on commit a61b7b7

Please sign in to comment.