Skip to content

Commit

Permalink
SliceConcatExt::connect defaults to calling join
Browse files Browse the repository at this point in the history
  • Loading branch information
czipperz committed May 25, 2019
1 parent fc45382 commit 3dd114e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,9 @@ pub trait SliceConcatExt<T: ?Sized> {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.3.0", reason = "renamed to join")]
fn connect(&self, sep: &T) -> Self::Output;
fn connect(&self, sep: &T) -> Self::Output {
self.join(sep)
}
}

#[unstable(feature = "slice_concat_ext",
Expand Down Expand Up @@ -616,10 +618,6 @@ impl<T: Clone, V: Borrow<[T]>> SliceConcatExt<T> for [V] {
}
result
}

fn connect(&self, sep: &T) -> Vec<T> {
self.join(sep)
}
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 0 additions & 4 deletions src/liballoc/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ impl<S: Borrow<str>> SliceConcatExt<str> for [S] {
String::from_utf8_unchecked( join_generic_copy(self, sep.as_bytes()) )
}
}

fn connect(&self, sep: &str) -> String {
self.join(sep)
}
}

macro_rules! spezialize_for_lengths {
Expand Down

0 comments on commit 3dd114e

Please sign in to comment.