We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d412c6 commit 91f1e51Copy full SHA for 91f1e51
src/libcollections/string.rs
@@ -1005,6 +1005,14 @@ impl AsRef<str> for String {
1005
}
1006
1007
1008
+#[stable(feature = "rust1", since = "1.0.0")]
1009
+impl AsRef<[u8]> for String {
1010
+ #[inline]
1011
+ fn as_ref(&self) -> &[u8] {
1012
+ self.as_bytes()
1013
+ }
1014
+}
1015
+
1016
#[stable(feature = "rust1", since = "1.0.0")]
1017
impl<'a> From<&'a str> for String {
1018
#[inline]
0 commit comments