Skip to content

Commit 3dd114e

Browse files
committed
SliceConcatExt::connect defaults to calling join
1 parent fc45382 commit 3dd114e

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/liballoc/slice.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,9 @@ pub trait SliceConcatExt<T: ?Sized> {
582582
/// ```
583583
#[stable(feature = "rust1", since = "1.0.0")]
584584
#[rustc_deprecated(since = "1.3.0", reason = "renamed to join")]
585-
fn connect(&self, sep: &T) -> Self::Output;
585+
fn connect(&self, sep: &T) -> Self::Output {
586+
self.join(sep)
587+
}
586588
}
587589

588590
#[unstable(feature = "slice_concat_ext",
@@ -616,10 +618,6 @@ impl<T: Clone, V: Borrow<[T]>> SliceConcatExt<T> for [V] {
616618
}
617619
result
618620
}
619-
620-
fn connect(&self, sep: &T) -> Vec<T> {
621-
self.join(sep)
622-
}
623621
}
624622

625623
////////////////////////////////////////////////////////////////////////////////

src/liballoc/str.rs

-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ impl<S: Borrow<str>> SliceConcatExt<str> for [S] {
8686
String::from_utf8_unchecked( join_generic_copy(self, sep.as_bytes()) )
8787
}
8888
}
89-
90-
fn connect(&self, sep: &str) -> String {
91-
self.join(sep)
92-
}
9389
}
9490

9591
macro_rules! spezialize_for_lengths {

0 commit comments

Comments
 (0)