librustuv: Remove all uses of ~str from librustuv

This commit is contained in:
Patrick Walton 2014-05-14 20:55:16 -07:00
parent 78bc758c94
commit ce11f19695
3 changed files with 7 additions and 7 deletions

View File

@ -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()
}
}

View File

@ -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()),
}
}

View File

@ -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()),
}
}