From 78c1ae279175b78b0118a5acfd69f82085b9cfc1 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 3 May 2015 05:27:36 +0200 Subject: [PATCH] doc: make concat() and connect() examples brief --- src/libcollections/slice.rs | 12 ++---------- 1 file 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 { /// # 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 { /// # 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;