From: Phoebe Bell Date: Thu, 26 Dec 2019 19:57:57 +0000 (-0800) Subject: Apply suggestions from code review X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=e0140ffeb0a7378f6568f5b8efebcfc58278f03a;p=rust.git Apply suggestions from code review Co-Authored-By: Ralf Jung --- diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 3139d6188e2..f89edf1910f 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -659,7 +659,7 @@ impl<'a> Chars<'a> { #[stable(feature = "iter_to_slice", since = "1.4.0")] #[inline] pub fn as_str(&self) -> &'a str { - // SAFETY: Chars is only made from a str, which guarantees the iter is valid utf8 + // SAFETY: `Chars` is only made from a str, which guarantees the iter is valid utf8 unsafe { from_utf8_unchecked(self.iter.as_slice()) } } }