From 3af8e14cd13090d7630b40bf7515d228e3bd8fa9 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 1 Jun 2015 00:26:11 +0200 Subject: [PATCH] doc: make String::as_bytes example more simple --- src/libcollections/string.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 7563bb76b52..c328a58f077 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -495,8 +495,7 @@ impl String { /// /// ``` /// let s = String::from("hello"); - /// let b: &[_] = &[104, 101, 108, 108, 111]; - /// assert_eq!(s.as_bytes(), b); + /// assert_eq!(s.as_bytes(), [104, 101, 108, 108, 111]); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")]