We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
unnecessary_to_owned
1 parent c1a4a69 commit 995238cCopy full SHA for 995238c
alloc/src/string.rs
@@ -571,6 +571,7 @@ impl String {
571
/// [`into_bytes`]: String::into_bytes
572
#[inline]
573
#[stable(feature = "rust1", since = "1.0.0")]
574
+ #[cfg_attr(not(test), rustc_diagnostic_item = "string_from_utf8")]
575
pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error> {
576
match str::from_utf8(&vec) {
577
Ok(..) => Ok(String { vec }),
0 commit comments