Skip to content

Commit a369a0e

Browse files
committed
---
yaml --- r: 67244 b: refs/heads/master c: 9c3679a h: refs/heads/master v: v3
1 parent d5a8c59 commit a369a0e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d573ecd1f99944ca45837cbfc2efddcbddae8761
2+
refs/heads/master: 9c3679a9a2caeacdd16735c64ab4837721287e64
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libstd/str.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ pub trait OwnedStr {
20282028
fn pop_char(&mut self) -> char;
20292029
fn shift_char(&mut self) -> char;
20302030
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;
20322032
fn reserve(&mut self, n: uint);
20332033
fn reserve_at_least(&mut self, n: uint);
20342034
fn capacity(&self) -> uint;
@@ -2162,11 +2162,10 @@ impl OwnedStr for ~str {
21622162
21632163
/// Concatenate two strings together.
21642164
#[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
21702169
}
21712170
21722171
/**

0 commit comments

Comments
 (0)