Skip to content

Commit

Permalink
fix a build error caused by that the Zero trait is no longer implemen…
Browse files Browse the repository at this point in the history
…ted for Duration
  • Loading branch information
nanne007 committed Nov 26, 2014
1 parent 20d97cb commit 83f933d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/options.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use consts::SocketOption;

use std::num::Zero;
use std::time::duration::Duration;


Expand Down Expand Up @@ -31,7 +30,7 @@ impl Options {
type_: -1,
maxmsgsize: -1,
reconnect_ivl: Duration::milliseconds(100),
reconnect_ivl_max: Zero::zero(),
reconnect_ivl_max: Duration::zero(),
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/tcp_connecter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use stream_engine::StreamEngine;
use std::cmp;
use std::io::net::ip::SocketAddr;
use std::io::{TcpStream, timer};
use std::num;
use std::num::{Zero, SignedInt};
use std::num::SignedInt;
use std::rand;
use std::sync::{RWLock, Arc};
use std::time::duration::Duration;
Expand Down Expand Up @@ -49,7 +48,7 @@ impl TcpConnecter {

// Only change the current reconnect interval if the maximum reconnect
// interval was set and if it's larger than the reconnect interval.
if reconnect_ivl_max > Zero::zero() && reconnect_ivl_max > reconnect_ivl {
if reconnect_ivl_max > Duration::zero() && reconnect_ivl_max > reconnect_ivl {
// Calculate the next interval
self.current_reconnect_ivl =
cmp::min (self.current_reconnect_ivl * 2, reconnect_ivl_max);
Expand Down

0 comments on commit 83f933d

Please sign in to comment.