We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 91c397a + a9dbb79 commit 8aa9876Copy full SHA for 8aa9876
src/libcollections/string.rs
@@ -859,6 +859,16 @@ impl<'a, S: Str> Equiv<S> for String {
859
#[cfg(stage0)]
860
#[experimental = "waiting on Add stabilization"]
861
impl<S: Str> Add<S, String> for String {
862
+ /// Concatenates `self` and `other` as a new mutable `String`.
863
+ ///
864
+ /// # Examples
865
866
+ /// ```
867
+ /// let string1 = "foo".to_string();
868
+ /// let string2 = "bar".to_string();
869
+ /// let string3 = string1 + string2;
870
+ /// assert_eq!(string3, "foobar".to_string());
871
872
fn add(&self, other: &S) -> String {
873
let mut s = String::from_str(self.as_slice());
874
s.push_str(other.as_slice());
0 commit comments