Skip to content

Commit fe41cce

Browse files
committed
Rename str::to_unique to str::to_owned.
1 parent ac50046 commit fe41cce

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/libcore/extfmt.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,11 @@ pub mod rt {
329329
// For strings, precision is the maximum characters
330330
// displayed
331331
let mut unpadded = match cv.precision {
332-
CountImplied => s.to_unique(),
332+
CountImplied => s.to_owned(),
333333
CountIs(max) => if max as uint < str::char_len(s) {
334334
str::substr(s, 0u, max as uint)
335335
} else {
336-
s.to_unique()
336+
s.to_owned()
337337
}
338338
};
339339
return unsafe { pad(cv, move unpadded, PadNozero) };

src/libcore/option.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ pub fn swap_unwrap<T>(opt: &mut Option<T>) -> T {
225225

226226
pub pure fn unwrap_expect<T>(opt: Option<T>, reason: &str) -> T {
227227
//! As unwrap, but with a specified failure message.
228-
if opt.is_none() { fail reason.to_unique(); }
228+
if opt.is_none() { fail reason.to_owned(); }
229229
unwrap(move opt)
230230
}
231231

src/libcore/str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ pub trait StrSlice {
21352135
pure fn trim() -> ~str;
21362136
pure fn trim_left() -> ~str;
21372137
pure fn trim_right() -> ~str;
2138-
pure fn to_unique() -> ~str;
2138+
pure fn to_owned() -> ~str;
21392139
pure fn to_managed() -> @str;
21402140
pure fn char_at(i: uint) -> char;
21412141
}
@@ -2258,7 +2258,7 @@ impl &str: StrSlice {
22582258
pure fn trim_right() -> ~str { trim_right(self) }
22592259

22602260
#[inline]
2261-
pure fn to_unique() -> ~str { self.slice(0, self.len()) }
2261+
pure fn to_owned() -> ~str { self.slice(0, self.len()) }
22622262

22632263
#[inline]
22642264
pure fn to_managed() -> @str {

src/libstd/json.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ pub impl Deserializer: serialization::Deserializer {
897897
// FIXME(#3148) This hint should not be necessary.
898898
let obj: &self/~Object = obj;
899899

900-
match obj.find_ref(&name.to_unique()) {
900+
match obj.find_ref(&name.to_owned()) {
901901
None => fail fmt!("no such field: %s", name),
902902
Some(json) => {
903903
self.stack.push(json);

0 commit comments

Comments
 (0)