We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a80b22 commit 3755711Copy full SHA for 3755711
src/libcollections/string.rs
@@ -1057,6 +1057,14 @@ impl AsRef<str> for String {
1057
}
1058
1059
1060
+#[stable(feature = "rust1", since = "1.1.0")]
1061
+impl AsRef<[u8]> for String {
1062
+ #[inline]
1063
+ fn as_ref(&self) -> &[u8] {
1064
+ self.as_bytes()
1065
+ }
1066
+}
1067
+
1068
#[stable(feature = "rust1", since = "1.0.0")]
1069
impl<'a> From<&'a str> for String {
1070
#[cfg(not(test))]
0 commit comments