Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/examples/msgsend/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand All @@ -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()),
}
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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::<uint>(s).unwrap()),
Err(e) => fail!(e.to_str()),
Err(e) => fail!(e.to_string()),
};

let end = time::precise_time_s();
Expand Down
6 changes: 3 additions & 3 deletions src/zmq/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}
Expand Down Expand Up @@ -397,7 +397,7 @@ impl Socket {

pub fn recv_str(&mut self, flags: int) -> Result<String, Error> {
match self.recv_msg(flags) {
Ok(msg) => Ok(msg.to_str()),
Ok(msg) => Ok(msg.to_string()),
Err(e) => Err(e),
}
}
Expand Down Expand Up @@ -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())
}
}
Expand Down