File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -2028,7 +2028,7 @@ pub trait OwnedStr {
2028
2028
fn pop_char(&mut self) -> char;
2029
2029
fn shift_char(&mut self) -> char;
2030
2030
fn unshift_char(&mut self, ch: char);
2031
- fn append(& self, rhs: &str) -> ~str; // FIXME #4850: this should consume self.
2031
+ fn append(self, rhs: &str) -> ~str;
2032
2032
fn reserve(&mut self, n: uint);
2033
2033
fn reserve_at_least(&mut self, n: uint);
2034
2034
fn capacity(&self) -> uint;
@@ -2162,11 +2162,10 @@ impl OwnedStr for ~str {
2162
2162
2163
2163
/// Concatenate two strings together.
2164
2164
#[inline]
2165
- fn append(&self, rhs: &str) -> ~str {
2166
- // FIXME #4850: this should consume self, but that causes segfaults
2167
- let mut v = self.clone();
2168
- v.push_str_no_overallocate(rhs);
2169
- v
2165
+ fn append(self, rhs: &str) -> ~str {
2166
+ let mut new_str = self;
2167
+ new_str.push_str_no_overallocate(rhs);
2168
+ new_str
2170
2169
}
2171
2170
2172
2171
/**
You can’t perform that action at this time.
0 commit comments