File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,10 @@ impl str {
273273 core_str:: StrExt :: is_char_boundary ( self , index)
274274 }
275275
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
277280 ///
278281 /// # Examples
279282 ///
@@ -289,7 +292,11 @@ impl str {
289292 core_str:: StrExt :: as_bytes ( self )
290293 }
291294
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
293300 #[ stable( feature = "str_mut_extras" , since = "1.20.0" ) ]
294301 #[ inline( always) ]
295302 pub unsafe fn as_bytes_mut ( & mut self ) -> & mut [ u8 ] {
You can’t perform that action at this time.
0 commit comments