[Clippy] Swap unnecessary_to_owned
to use diagnostic item instead o… · qinheping/verify-rust-std@995238c (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 995238c
[Clippy] Swap unnecessary_to_owned
to use diagnostic item instead of path
File tree
1 file changed
lines changed
1 file changed
lines changed
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -571,6 +571,7 @@ impl String { | ||
571 | 571 | /// [`into_bytes`]: String::into_bytes |
572 | 572 | #[inline] |
573 | 573 | #[stable(feature = "rust1", since = "1.0.0")] |
574 | +#[cfg_attr(not(test), rustc_diagnostic_item = "string_from_utf8")] | |
574 | 575 | pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error> { |
575 | 576 | match str::from_utf8(&vec) { |
576 | 577 | Ok(..) => Ok(String { vec }), |