[Clippy] Swap redundant_clone
to use diagnostic items instead of paths · qinheping/verify-rust-std@a61b7b7 (original) (raw)
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -919,6 +919,7 @@ impl OsStr { | ||
919 | 919 | #[must_use = "this returns the result of the operation, \ |
920 | 920 | without modifying the original"] |
921 | 921 | #[inline] |
922 | +#[cfg_attr(not(test), rustc_diagnostic_item = "os_str_to_os_string")] | |
922 | 923 | pub fn to_os_string(&self) -> OsString { |
923 | 924 | OsString { inner: self.inner.to_owned() } |
924 | 925 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2265,6 +2265,7 @@ impl Path { | ||
2265 | 2265 | #[must_use = "this returns the result of the operation, \ |
2266 | 2266 | without modifying the original"] |
2267 | 2267 | #[stable(feature = "rust1", since = "1.0.0")] |
2268 | +#[cfg_attr(not(test), rustc_diagnostic_item = "path_to_pathbuf")] | |
2268 | 2269 | pub fn to_path_buf(&self) -> PathBuf { |
2269 | 2270 | PathBuf::from(self.inner.to_os_string()) |
2270 | 2271 | } |