diff --git a/src/librustuv/lib.rs b/src/librustuv/lib.rs index 141e3e515ac..a9b449e63be 100644 --- a/src/librustuv/lib.rs +++ b/src/librustuv/lib.rs @@ -353,21 +353,21 @@ impl Loop { pub struct UvError(c_int); impl UvError { - pub fn name(&self) -> ~str { + pub fn name(&self) -> StrBuf { unsafe { let inner = match self { &UvError(a) => a }; let name_str = uvll::uv_err_name(inner); assert!(name_str.is_not_null()); - from_c_str(name_str) + from_c_str(name_str).to_strbuf() } } - pub fn desc(&self) -> ~str { + pub fn desc(&self) -> StrBuf { unsafe { let inner = match self { &UvError(a) => a }; let desc_str = uvll::uv_strerror(inner); assert!(desc_str.is_not_null()); - from_c_str(desc_str) + from_c_str(desc_str).to_strbuf() } } diff --git a/src/librustuv/net.rs b/src/librustuv/net.rs index 798c9ac3cab..0b31010020b 100644 --- a/src/librustuv/net.rs +++ b/src/librustuv/net.rs @@ -851,7 +851,7 @@ mod test { fn connect_close_ip4() { match TcpWatcher::connect(local_loop(), next_test_ip4(), None) { Ok(..) => fail!(), - Err(e) => assert_eq!(e.name(), "ECONNREFUSED".to_owned()), + Err(e) => assert_eq!(e.name(), "ECONNREFUSED".to_strbuf()), } } @@ -859,7 +859,7 @@ mod test { fn connect_close_ip6() { match TcpWatcher::connect(local_loop(), next_test_ip6(), None) { Ok(..) => fail!(), - Err(e) => assert_eq!(e.name(), "ECONNREFUSED".to_owned()), + Err(e) => assert_eq!(e.name(), "ECONNREFUSED".to_strbuf()), } } diff --git a/src/librustuv/pipe.rs b/src/librustuv/pipe.rs index ba39f8a7f5f..cf3035c742c 100644 --- a/src/librustuv/pipe.rs +++ b/src/librustuv/pipe.rs @@ -338,7 +338,7 @@ mod tests { fn bind_err() { match PipeListener::bind(local_loop(), &"path/to/nowhere".to_c_str()) { Ok(..) => fail!(), - Err(e) => assert_eq!(e.name(), "EACCES".to_owned()), + Err(e) => assert_eq!(e.name(), "EACCES".to_strbuf()), } }