@@ -6,6 +6,8 @@ use crate::{mem, ptr};
66
77/// Converts a slice of bytes to a string slice.
88///
9+ /// This is an alias to [`str::from_utf8`].
10+ ///
911/// A string slice ([`&str`]) is made of bytes ([`u8`]), and a byte slice
1012/// ([`&[u8]`][byteslice]) is made of bytes, so this function converts between
1113/// the two. Not all byte slices are valid string slices, however: [`&str`] requires
@@ -97,6 +99,8 @@ pub const fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
9799
98100/// Converts a mutable slice of bytes to a mutable string slice.
99101///
102+ /// This is an alias to [`str::from_utf8_mut`].
103+ ///
100104/// # Examples
101105///
102106/// Basic usage:
@@ -142,6 +146,8 @@ pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
142146/// Converts a slice of bytes to a string slice without checking
143147/// that the string contains valid UTF-8.
144148///
149+ /// This is an alias to [`str::from_utf8_unchecked`].
150+ ///
145151/// See the safe version, [`from_utf8`], for more information.
146152///
147153/// # Safety
@@ -178,6 +184,8 @@ pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
178184/// Converts a slice of bytes to a string slice without checking
179185/// that the string contains valid UTF-8; mutable version.
180186///
187+ /// This is an alias to [`str::from_utf8_unchecked_mut`].
188+ ///
181189/// See the immutable version, [`from_utf8_unchecked()`] for documentation and safety requirements.
182190///
183191/// # Examples
0 commit comments