diff options
| author | Ralf Jung <post@ralfj.de> | 2019-04-15 16:34:08 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-04-15 16:35:50 +0200 |
| commit | 50c615baa2c09694f0ba446c53777e98db88ed01 (patch) | |
| tree | 39d0229f03a7976e170c8015b5507eb5a55fbfac /src/liballoc/slice.rs | |
| parent | 8ef7ca130271369400719c712369c33a30d6528b (diff) | |
| download | rust-50c615baa2c09694f0ba446c53777e98db88ed01.tar.gz rust-50c615baa2c09694f0ba446c53777e98db88ed01.zip | |
warn(missing_docs) in liballoc, and add missing docs
Diffstat (limited to 'src/liballoc/slice.rs')
| -rw-r--r-- | src/liballoc/slice.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index f4b2d463778..6eac8487401 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -570,6 +570,16 @@ pub trait SliceConcatExt<T: ?Sized> { #[stable(feature = "rename_connect_to_join", since = "1.3.0")] fn join(&self, sep: &T) -> Self::Output; + /// Flattens a slice of `T` into a single value `Self::Output`, placing a + /// given separator between each. + /// + /// # Examples + /// + /// ``` + /// # #![allow(deprecated)] + /// assert_eq!(["hello", "world"].connect(" "), "hello world"); + /// assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]); + /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[rustc_deprecated(since = "1.3.0", reason = "renamed to join")] fn connect(&self, sep: &T) -> Self::Output; |
