File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -967,11 +967,30 @@ impl<T> SliceExt for [T] {
967967/// An extension trait for concatenating slices
968968pub trait SliceConcatExt < T : ?Sized , U > {
969969 /// Flattens a slice of `T` into a single value `U`.
970+ ///
971+ /// # Examples
972+ ///
973+ /// ```
974+ /// let v = vec!["hello", "world"];
975+ ///
976+ /// let s: String = v.concat();
977+ ///
978+ /// println!("{}", s); // prints "helloworld"
979+ /// ```
970980 #[ stable]
971981 fn concat ( & self ) -> U ;
972982
973- /// Flattens a slice of `T` into a single value `U`, placing a
974- /// given separator between each.
983+ /// Flattens a slice of `T` into a single value `U`, placing a given separator between each.
984+ ///
985+ /// # Examples
986+ ///
987+ /// ```
988+ /// let v = vec!["hello", "world"];
989+ ///
990+ /// let s: String = v.connect(" ");
991+ ///
992+ /// println!("{}", s); // prints "hello world"
993+ /// ```
975994 #[ stable]
976995 fn connect ( & self , sep : & T ) -> U ;
977996}
You can’t perform that action at this time.
0 commit comments