Skip to content

Commit 78c1ae2

Browse files
committed
doc: make concat() and connect() examples brief
1 parent f6574c5 commit 78c1ae2

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/libcollections/slice.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -1004,11 +1004,7 @@ pub trait SliceConcatExt<T: ?Sized, U> {
10041004
/// # Examples
10051005
///
10061006
/// ```
1007-
/// let v = vec!["hello", "world"];
1008-
///
1009-
/// let s: String = v.concat();
1010-
///
1011-
/// println!("{}", s); // prints "helloworld"
1007+
/// assert_eq!(["hello", "world"].concat(), "helloworld");
10121008
/// ```
10131009
#[stable(feature = "rust1", since = "1.0.0")]
10141010
fn concat(&self) -> U;
@@ -1018,11 +1014,7 @@ pub trait SliceConcatExt<T: ?Sized, U> {
10181014
/// # Examples
10191015
///
10201016
/// ```
1021-
/// let v = vec!["hello", "world"];
1022-
///
1023-
/// let s: String = v.connect(" ");
1024-
///
1025-
/// println!("{}", s); // prints "hello world"
1017+
/// assert_eq!(["hello", "world"].connect(" "), "hello world");
10261018
/// ```
10271019
#[stable(feature = "rust1", since = "1.0.0")]
10281020
fn connect(&self, sep: &T) -> U;

0 commit comments

Comments
 (0)