rollup merge of #19972: alexcrichton/snapshots
Conflicts: src/libcollections/string.rs src/libcollections/vec.rs src/snapshots.txt
This commit is contained in:
commit
dbeef0edb2
11 changed files with 0 additions and 833 deletions
|
|
@ -862,28 +862,7 @@ impl<'a, S: Str> Equiv<S> for String {
|
|||
}
|
||||
}
|
||||
|
||||
// NOTE(stage0): Remove impl after a snapshot
|
||||
#[cfg(stage0)]
|
||||
#[experimental = "waiting on Add stabilization"]
|
||||
impl<S: Str> Add<S, String> for String {
|
||||
/// Concatenates `self` and `other` as a new mutable `String`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let string1 = "foo".to_string();
|
||||
/// let string2 = "bar".to_string();
|
||||
/// let string3 = string1 + string2;
|
||||
/// assert_eq!(string3, "foobar".to_string());
|
||||
/// ```
|
||||
fn add(&self, other: &S) -> String {
|
||||
let mut s = String::from_str(self.as_slice());
|
||||
s.push_str(other.as_slice());
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
|
||||
impl<'a> Add<&'a str, String> for String {
|
||||
fn add(mut self, other: &str) -> String {
|
||||
self.push_str(other);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue