about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-05-03 07:08:13 +0000
committerbors <bors@rust-lang.org>2015-05-03 07:08:13 +0000
commit07915ef6a1426952ba612c02ecafad003bf971a3 (patch)
tree7ca955a70d6bb459c5b93d94c3bc7ac665744bff /src
parent0d7d3ec9d2b314af0188a820c58fbd95ee905793 (diff)
parent78c1ae279175b78b0118a5acfd69f82085b9cfc1 (diff)
downloadrust-07915ef6a1426952ba612c02ecafad003bf971a3.tar.gz
rust-07915ef6a1426952ba612c02ecafad003bf971a3.zip
Auto merge of #25064 - tshepang:brevity, r=alexcrichton
Diffstat (limited to 'src')
-rw-r--r--src/libcollections/slice.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs
index 6622d8a9c40..729b0ebc3ce 100644
--- a/src/libcollections/slice.rs
+++ b/src/libcollections/slice.rs
@@ -1004,11 +1004,7 @@ pub trait SliceConcatExt<T: ?Sized, U> {
     /// # Examples
     ///
     /// ```
-    /// let v = vec!["hello", "world"];
-    ///
-    /// let s: String = v.concat();
-    ///
-    /// println!("{}", s); // prints "helloworld"
+    /// assert_eq!(["hello", "world"].concat(), "helloworld");
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     fn concat(&self) -> U;
@@ -1018,11 +1014,7 @@ pub trait SliceConcatExt<T: ?Sized, U> {
     /// # Examples
     ///
     /// ```
-    /// let v = vec!["hello", "world"];
-    ///
-    /// let s: String = v.connect(" ");
-    ///
-    /// println!("{}", s); // prints "hello world"
+    /// assert_eq!(["hello", "world"].connect(" "), "hello world");
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     fn connect(&self, sep: &T) -> U;