We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18ef0de commit 8adf50dCopy full SHA for 8adf50d
src/libcore/str/mod.rs
@@ -395,21 +395,6 @@ pub unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
395
///
396
/// assert_eq!("💖", heart);
397
/// ```
398
-///
399
-/// Invalid UTF-8:
400
401
-/// ```
402
-/// use std::str;
403
404
-/// // Invalid bytes.
405
-/// let mut bytes = vec![240, 40, 140, 188];
406
407
-/// // Returns a str:
408
-/// unsafe { str::from_utf8_unchecked_mut(&mut bytes) };
409
410
-/// // from_utf8 returns an error instead:
411
-/// assert!(str::from_utf8(&bytes).is_err());
412
413
#[inline]
414
#[stable(feature = "str_mut_extras", since = "1.20.0")]
415
pub unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str {
0 commit comments