Rename str::to_unique to str::to_owned.

This commit is contained in:
Erick Tryzelaar 2012-10-18 11:04:59 -07:00
parent ac50046a11
commit fe41ccec64
4 changed files with 6 additions and 6 deletions

View File

@ -329,11 +329,11 @@ pub mod rt {
// For strings, precision is the maximum characters
// displayed
let mut unpadded = match cv.precision {
CountImplied => s.to_unique(),
CountImplied => s.to_owned(),
CountIs(max) => if max as uint < str::char_len(s) {
str::substr(s, 0u, max as uint)
} else {
s.to_unique()
s.to_owned()
}
};
return unsafe { pad(cv, move unpadded, PadNozero) };

View File

@ -225,7 +225,7 @@ pub fn swap_unwrap<T>(opt: &mut Option<T>) -> T {
pub pure fn unwrap_expect<T>(opt: Option<T>, reason: &str) -> T {
//! As unwrap, but with a specified failure message.
if opt.is_none() { fail reason.to_unique(); }
if opt.is_none() { fail reason.to_owned(); }
unwrap(move opt)
}

View File

@ -2135,7 +2135,7 @@ pub trait StrSlice {
pure fn trim() -> ~str;
pure fn trim_left() -> ~str;
pure fn trim_right() -> ~str;
pure fn to_unique() -> ~str;
pure fn to_owned() -> ~str;
pure fn to_managed() -> @str;
pure fn char_at(i: uint) -> char;
}
@ -2258,7 +2258,7 @@ impl &str: StrSlice {
pure fn trim_right() -> ~str { trim_right(self) }
#[inline]
pure fn to_unique() -> ~str { self.slice(0, self.len()) }
pure fn to_owned() -> ~str { self.slice(0, self.len()) }
#[inline]
pure fn to_managed() -> @str {

View File

@ -897,7 +897,7 @@ pub impl Deserializer: serialization::Deserializer {
// FIXME(#3148) This hint should not be necessary.
let obj: &self/~Object = obj;
match obj.find_ref(&name.to_unique()) {
match obj.find_ref(&name.to_owned()) {
None => fail fmt!("no such field: %s", name),
Some(json) => {
self.stack.push(json);