about summary refs log tree commit diff
path: root/src/libstd/sys/unix/condvar.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-17 15:32:42 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-21 11:37:43 -0700
commiteeb94886adccb3f13003f92f117115d17846ce1f (patch)
tree2d729b8e48c5022941e2c06e412a2b2a1744ca1c /src/libstd/sys/unix/condvar.rs
parente091ba3f3e8b2b00827ab4934314829b33ffb966 (diff)
downloadrust-eeb94886adccb3f13003f92f117115d17846ce1f.tar.gz
rust-eeb94886adccb3f13003f92f117115d17846ce1f.zip
std: Remove deprecated/unstable num functionality
This commit removes all the old casting/generic traits from `std::num` that are
no longer in use by the standard library. This additionally removes the old
`strconv` module which has not seen much use in quite a long time. All generic
functionality has been supplanted with traits in the `num` crate and the
`strconv` module is supplanted with the [rust-strconv crate][rust-strconv].

[rust-strconv]: https://github.com/lifthrasiir/rust-strconv

This is a breaking change due to the removal of these deprecated crates, and the
alternative crates are listed above.

[breaking-change]
Diffstat (limited to 'src/libstd/sys/unix/condvar.rs')
-rw-r--r--src/libstd/sys/unix/condvar.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstd/sys/unix/condvar.rs b/src/libstd/sys/unix/condvar.rs
index 90dfebc4c45..ed6382e000a 100644
--- a/src/libstd/sys/unix/condvar.rs
+++ b/src/libstd/sys/unix/condvar.rs
@@ -17,7 +17,6 @@ use sys::mutex::{self, Mutex};
 use sys::time;
 use sys::sync as ffi;
 use time::Duration;
-use num::{Int, NumCast};
 
 pub struct Condvar { inner: UnsafeCell<ffi::pthread_cond_t> }
 
@@ -70,8 +69,8 @@ impl Condvar {
         let r = ffi::gettimeofday(&mut sys_now, ptr::null_mut());
         debug_assert_eq!(r, 0);
 
-        let seconds = NumCast::from(dur.num_seconds());
-        let timeout = match seconds.and_then(|s| sys_now.tv_sec.checked_add(s)) {
+        let seconds = dur.num_seconds() as libc::time_t;
+        let timeout = match sys_now.tv_sec.checked_add(seconds) {
             Some(sec) => {
                 libc::timespec {
                     tv_sec: sec,
@@ -81,7 +80,7 @@ impl Condvar {
             }
             None => {
                 libc::timespec {
-                    tv_sec: Int::max_value(),
+                    tv_sec: <libc::time_t>::max_value(),
                     tv_nsec: 1_000_000_000 - 1,
                 }
             }