mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Rollup merge of #61146 - czipperz:SliceConcatExt-connect-default-to-join, r=sfackler
SliceConcatExt::connect defaults to calling join It makes sense to default a deprecated method to the new one. Precedence example is `Error::cause` defaults to calling `Error::source`.
This commit is contained in:
@@ -581,7 +581,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",
|
||||
@@ -615,10 +617,6 @@ fn join(&self, sep: &T) -> Vec<T> {
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fn connect(&self, sep: &T) -> Vec<T> {
|
||||
self.join(sep)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -86,10 +86,6 @@ fn join(&self, sep: &str) -> String {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user