librustuv: Remove all uses of ~str
from librustuv
This commit is contained in:
parent
78bc758c94
commit
ce11f19695
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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()),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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()),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user