Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Commit faa327b

Browse files
committed
Merge pull request #138 from phsym/1.0
Fixed deprecation warnings introduced by Rust 1.6
2 parents d36d71a + 84df3dd commit faa327b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/topology/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use std::i64;
1818
use std::str::FromStr;
1919
use std::sync::{Arc, RwLock};
2020
use std::thread;
21+
use std::time::Duration;
2122
use time;
2223

2324
use self::server::{Server, ServerDescription, ServerType};
@@ -741,12 +742,12 @@ impl Topology {
741742
return Err(err)
742743
}
743744
// Otherwise, sleep for a little while.
744-
thread::sleep_ms(500);
745+
thread::sleep(Duration::from_millis(500));
745746
},
746747
}
747-
}
748+
}
748749
}
749-
750+
750751
/// Returns a server stream for read operations.
751752
pub fn acquire_stream(&self, read_preference: ReadPreference) -> Result<(PooledStream, bool, bool)> {
752753
self.acquire_stream_private(Some(read_preference), false)

src/topology/monitor.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use wire_protocol::flags::OpQueryFlags;
1515
use std::collections::BTreeMap;
1616
use std::sync::{Arc, Condvar, Mutex, RwLock};
1717
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
18+
use std::time::Duration;
1819

1920
use time;
2021

@@ -348,8 +349,8 @@ impl Monitor {
348349
Ordering::SeqCst);
349350
}
350351

351-
let frequency = self.heartbeat_frequency_ms.load(Ordering::SeqCst) as u32;
352-
guard = self.condvar.wait_timeout_ms(guard, frequency).unwrap().0;
352+
let frequency = self.heartbeat_frequency_ms.load(Ordering::SeqCst) as u64;
353+
guard = self.condvar.wait_timeout(guard, Duration::from_millis(frequency)).unwrap().0;
353354
}
354355
}
355356
}

0 commit comments

Comments
 (0)