doc: make String::as_bytes example more simple

This commit is contained in:
Tshepang Lekhonkhobe 2015-06-01 00:26:11 +02:00
parent 845cee4e20
commit 3af8e14cd1

View File

@ -495,8 +495,7 @@ impl String {
/// ///
/// ``` /// ```
/// let s = String::from("hello"); /// let s = String::from("hello");
/// let b: &[_] = &[104, 101, 108, 108, 111]; /// assert_eq!(s.as_bytes(), [104, 101, 108, 108, 111]);
/// assert_eq!(s.as_bytes(), b);
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]