about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTshepang Lekhonkhobe <tshepang@gmail.com>2015-06-01 00:26:11 +0200
committerTshepang Lekhonkhobe <tshepang@gmail.com>2015-06-01 00:26:11 +0200
commit3af8e14cd13090d7630b40bf7515d228e3bd8fa9 (patch)
treed16c4f61f435a7d99da670fc9ea53aa7385ea8d4
parent845cee4e20532d90454b2d2d1a55d0c2dfcfee09 (diff)
downloadrust-3af8e14cd13090d7630b40bf7515d228e3bd8fa9.tar.gz
rust-3af8e14cd13090d7630b40bf7515d228e3bd8fa9.zip
doc: make String::as_bytes example more simple
-rw-r--r--src/libcollections/string.rs3
1 files changed, 1 insertions, 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")]