Skip to content

Commit ce11f19

Browse files
committed
librustuv: Remove all uses of ~str from librustuv
1 parent 78bc758 commit ce11f19

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustuv/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,21 +353,21 @@ impl Loop {
353353
pub struct UvError(c_int);
354354

355355
impl UvError {
356-
pub fn name(&self) -> ~str {
356+
pub fn name(&self) -> StrBuf {
357357
unsafe {
358358
let inner = match self { &UvError(a) => a };
359359
let name_str = uvll::uv_err_name(inner);
360360
assert!(name_str.is_not_null());
361-
from_c_str(name_str)
361+
from_c_str(name_str).to_strbuf()
362362
}
363363
}
364364

365-
pub fn desc(&self) -> ~str {
365+
pub fn desc(&self) -> StrBuf {
366366
unsafe {
367367
let inner = match self { &UvError(a) => a };
368368
let desc_str = uvll::uv_strerror(inner);
369369
assert!(desc_str.is_not_null());
370-
from_c_str(desc_str)
370+
from_c_str(desc_str).to_strbuf()
371371
}
372372
}
373373

src/librustuv/net.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,15 +851,15 @@ mod test {
851851
fn connect_close_ip4() {
852852
match TcpWatcher::connect(local_loop(), next_test_ip4(), None) {
853853
Ok(..) => fail!(),
854-
Err(e) => assert_eq!(e.name(), "ECONNREFUSED".to_owned()),
854+
Err(e) => assert_eq!(e.name(), "ECONNREFUSED".to_strbuf()),
855855
}
856856
}
857857

858858
#[test]
859859
fn connect_close_ip6() {
860860
match TcpWatcher::connect(local_loop(), next_test_ip6(), None) {
861861
Ok(..) => fail!(),
862-
Err(e) => assert_eq!(e.name(), "ECONNREFUSED".to_owned()),
862+
Err(e) => assert_eq!(e.name(), "ECONNREFUSED".to_strbuf()),
863863
}
864864
}
865865

src/librustuv/pipe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ mod tests {
338338
fn bind_err() {
339339
match PipeListener::bind(local_loop(), &"path/to/nowhere".to_c_str()) {
340340
Ok(..) => fail!(),
341-
Err(e) => assert_eq!(e.name(), "EACCES".to_owned()),
341+
Err(e) => assert_eq!(e.name(), "EACCES".to_strbuf()),
342342
}
343343
}
344344

0 commit comments

Comments
 (0)