@@ -6,6 +6,7 @@ use crate::{mem, ptr};
6
6
7
7
/// Converts a slice of bytes to a string slice.
8
8
///
9
+ /// This is an alias to [`str::from_utf8`].
9
10
/// A string slice ([`&str`]) is made of bytes ([`u8`]), and a byte slice
10
11
/// ([`&[u8]`][byteslice]) is made of bytes, so this function converts between
11
12
/// the two. Not all byte slices are valid string slices, however: [`&str`] requires
@@ -97,6 +98,8 @@ pub const fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error> {
97
98
98
99
/// Converts a mutable slice of bytes to a mutable string slice.
99
100
///
101
+ /// This is an alias to [`str::from_utf8_mut`].
102
+ ///
100
103
/// # Examples
101
104
///
102
105
/// Basic usage:
@@ -142,6 +145,8 @@ pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
142
145
/// Converts a slice of bytes to a string slice without checking
143
146
/// that the string contains valid UTF-8.
144
147
///
148
+ /// This is an alias to [`str::from_utf8_unchecked`].
149
+ ///
145
150
/// See the safe version, [`from_utf8`], for more information.
146
151
///
147
152
/// # Safety
@@ -178,6 +183,8 @@ pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
178
183
/// Converts a slice of bytes to a string slice without checking
179
184
/// that the string contains valid UTF-8; mutable version.
180
185
///
186
+ /// This is an alias to [`str::from_utf8_unchecked_mut`].
187
+ ///
181
188
/// See the immutable version, [`from_utf8_unchecked()`] for documentation and safety requirements.
182
189
///
183
190
/// # Examples
0 commit comments