Skip to content

Commit

Permalink
implement AddAssign for String
Browse files Browse the repository at this point in the history
  • Loading branch information
oconnor663 committed Jul 17, 2016
1 parent 6aba7be commit 6a09df9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libcollections/string.rs
Expand Up @@ -59,7 +59,7 @@ use core::fmt;
use core::hash;
use core::iter::FromIterator;
use core::mem;
use core::ops::{self, Add, Index, IndexMut};
use core::ops::{self, Add, AddAssign, Index, IndexMut};
use core::ptr;
use core::str::pattern::Pattern;
use rustc_unicode::char::{decode_utf16, REPLACEMENT_CHARACTER};
Expand Down Expand Up @@ -1559,6 +1559,14 @@ impl<'a> Add<&'a str> for String {
}
}

#[stable(feature = "rust1", since = "1.11.0")]
impl<'a> AddAssign<&'a str> for String {
#[inline]
fn add_assign(&mut self, other: &str) {
self.push_str(other);
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl ops::Index<ops::Range<usize>> for String {
type Output = str;
Expand Down

0 comments on commit 6a09df9

Please sign in to comment.