auto merge of #5827 : nikomatsakis/rust/issue-5656-change-meaning-of-borrowed-self, r=pcwalton
See #5656 for details. r? @pcwalton
This commit is contained in:
commit
76f6606a8c
66 changed files with 2462 additions and 781 deletions
|
@ -318,7 +318,11 @@ pub fn slice_shift_char<'a>(s: &'a str) -> (char, &'a str) {
|
|||
|
||||
/// Prepend a char to a string
|
||||
pub fn unshift_char(s: &mut ~str, ch: char) {
|
||||
*s = from_char(ch) + *s;
|
||||
// This could be more efficient.
|
||||
let mut new_str = ~"";
|
||||
new_str.push_char(ch);
|
||||
new_str.push_str(*s);
|
||||
*s = new_str;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue