File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,10 @@ impl str {
273
273
core_str:: StrExt :: is_char_boundary ( self , index)
274
274
}
275
275
276
- /// Converts a string slice to a byte slice.
276
+ /// Converts a string slice to a byte slice. To convert the byte slice back
277
+ /// into a string slice, use the [`str::from_utf8`] function.
278
+ ///
279
+ /// [`str::from_utf8`]: ./str/fn.from_utf8.html
277
280
///
278
281
/// # Examples
279
282
///
@@ -289,7 +292,11 @@ impl str {
289
292
core_str:: StrExt :: as_bytes ( self )
290
293
}
291
294
292
- /// Converts a mutable string slice to a mutable byte slice.
295
+ /// Converts a mutable string slice to a mutable byte slice. To convert the
296
+ /// mutable byte slice back into a mutable string slice, use the
297
+ /// [`str::from_utf8_mut`] function.
298
+ ///
299
+ /// [`str::from_utf8_mut`]: ./str/fn.from_utf8_mut.html
293
300
#[ stable( feature = "str_mut_extras" , since = "1.20.0" ) ]
294
301
#[ inline( always) ]
295
302
pub unsafe fn as_bytes_mut ( & mut self ) -> & mut [ u8 ] {
You can’t perform that action at this time.
0 commit comments