diff --git a/src/examples/msgsend/main.rs b/src/examples/msgsend/main.rs index 24bce8f60..ed9c5fcc1 100644 --- a/src/examples/msgsend/main.rs +++ b/src/examples/msgsend/main.rs @@ -21,7 +21,7 @@ fn server(mut pull_socket: zmq::Socket, mut push_socket: zmq::Socket, mut worker while workers != 0 { match pull_socket.recv(&mut msg, 0) { - Err(e) => fail!(e.to_str()), + Err(e) => fail!(e.to_string()), Ok(()) => { msg.with_str(|s| { if s == "" { @@ -34,9 +34,9 @@ fn server(mut pull_socket: zmq::Socket, mut push_socket: zmq::Socket, mut worker } } - match push_socket.send_str(count.to_str().as_slice(), 0) { + match push_socket.send_str(count.to_string().as_slice(), 0) { Ok(()) => { } - Err(e) => fail!(e.to_str()), + Err(e) => fail!(e.to_string()), } } @@ -73,7 +73,7 @@ fn spawn_server(ctx: &mut zmq::Context, workers: uint) -> comm::Sender<()> { fn worker(mut push_socket: zmq::Socket, count: uint) { for _ in range(0, count) { - push_socket.send_str(100u.to_str().as_slice(), 0).unwrap(); + push_socket.send_str(100u.to_string().as_slice(), 0).unwrap(); } // Let the server know we're done. @@ -136,7 +136,7 @@ fn run(ctx: &mut zmq::Context, size: uint, workers: uint) { // Receive the final count. let result = match pull_socket.recv_msg(0) { Ok(msg) => msg.with_str(|s| from_str::(s).unwrap()), - Err(e) => fail!(e.to_str()), + Err(e) => fail!(e.to_string()), }; let end = time::precise_time_s(); diff --git a/src/zmq/lib.rs b/src/zmq/lib.rs index 494bbed2c..38559a556 100644 --- a/src/zmq/lib.rs +++ b/src/zmq/lib.rs @@ -317,7 +317,7 @@ impl Drop for Socket { fn drop(&mut self) { match self.close_final() { Ok(()) => { debug!("socket dropped") }, - Err(e) => fail!(e.to_str()) + Err(e) => fail!(e.to_string()) } } } @@ -397,7 +397,7 @@ impl Socket { pub fn recv_str(&mut self, flags: int) -> Result { match self.recv_msg(flags) { - Ok(msg) => Ok(msg.to_str()), + Ok(msg) => Ok(msg.to_string()), Err(e) => Err(e), } } @@ -636,7 +636,7 @@ impl Message { self.with_bytes(|v| v.to_owned()) } - pub fn to_str(&self) -> String { + pub fn to_string(&self) -> String { self.with_str(|s| s.to_string()) } }