Skip to content

Commit 283f676

Browse files
committed
Take separator by value in [T]::join
1 parent 01d93bf commit 283f676

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/liballoc/slice.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ impl<T> [T] {
510510
/// assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
511511
/// ```
512512
#[stable(feature = "rename_connect_to_join", since = "1.3.0")]
513-
pub fn join<Separator: ?Sized>(&self, sep: &Separator) -> <Self as Join<Separator>>::Output
513+
pub fn join<Separator>(&self, sep: Separator) -> <Self as Join<Separator>>::Output
514514
where Self: Join<Separator>
515515
{
516516
Join::join(self, sep)
@@ -528,7 +528,7 @@ impl<T> [T] {
528528
/// ```
529529
#[stable(feature = "rust1", since = "1.0.0")]
530530
#[rustc_deprecated(since = "1.3.0", reason = "renamed to join")]
531-
pub fn connect<Separator: ?Sized>(&self, sep: &Separator) -> <Self as Join<Separator>>::Output
531+
pub fn connect<Separator>(&self, sep: Separator) -> <Self as Join<Separator>>::Output
532532
where Self: Join<Separator>
533533
{
534534
Join::join(self, sep)
@@ -620,14 +620,14 @@ pub trait Concat<Item: ?Sized> {
620620

621621
/// Helper trait for [`[T]::join`](../../std/primitive.slice.html#method.join)
622622
#[unstable(feature = "slice_concat_trait", issue = "27747")]
623-
pub trait Join<Separator: ?Sized> {
623+
pub trait Join<Separator> {
624624
#[unstable(feature = "slice_concat_trait", issue = "27747")]
625625
/// The resulting type after concatenation
626626
type Output;
627627

628628
/// Implementation of [`[T]::join`](../../std/primitive.slice.html#method.join)
629629
#[unstable(feature = "slice_concat_trait", issue = "27747")]
630-
fn join(slice: &Self, sep: &Separator) -> Self::Output;
630+
fn join(slice: &Self, sep: Separator) -> Self::Output;
631631
}
632632

633633
#[unstable(feature = "slice_concat_ext", issue = "27747")]
@@ -645,7 +645,7 @@ impl<T: Clone, V: Borrow<[T]>> Concat<T> for [V] {
645645
}
646646

647647
#[unstable(feature = "slice_concat_ext", issue = "27747")]
648-
impl<T: Clone, V: Borrow<[T]>> Join<T> for [V] {
648+
impl<T: Clone, V: Borrow<[T]>> Join<&'_ T> for [V] {
649649
type Output = Vec<T>;
650650

651651
fn join(slice: &Self, sep: &T) -> Vec<T> {

src/liballoc/str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<S: Borrow<str>> Concat<str> for [S] {
8383
}
8484

8585
#[unstable(feature = "slice_concat_ext", issue = "27747")]
86-
impl<S: Borrow<str>> Join<str> for [S] {
86+
impl<S: Borrow<str>> Join<&'_ str> for [S] {
8787
type Output = String;
8888

8989
fn join(slice: &Self, sep: &str) -> String {

0 commit comments

Comments
 (0)