about summary refs log tree commit diff
path: root/src/libstd/sys/unix
diff options
context:
space:
mode:
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-11-10 09:35:53 +1100
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-11-13 02:04:31 +1100
commit46333d527b138e8e202380a5ce4409dfe1414148 (patch)
tree12a9e363e31b019f74bcf9748fd2bc58770fd86d /src/libstd/sys/unix
parent0da49dcf1352bc038bb32c1a7bc1ac1be50d541c (diff)
downloadrust-46333d527b138e8e202380a5ce4409dfe1414148.tar.gz
rust-46333d527b138e8e202380a5ce4409dfe1414148.zip
Deprecate Zero and One traits
Diffstat (limited to 'src/libstd/sys/unix')
-rw-r--r--src/libstd/sys/unix/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs
index de104335d7c..939ae79facf 100644
--- a/src/libstd/sys/unix/mod.rs
+++ b/src/libstd/sys/unix/mod.rs
@@ -116,11 +116,11 @@ pub fn decode_error_detailed(errno: i32) -> IoError {
 }
 
 #[inline]
-pub fn retry<I: PartialEq + num::One + Neg<I>> (f: || -> I) -> I {
-    let minus_one = -num::one::<I>();
+pub fn retry<T: Signed + Int> (f: || -> T) -> T {
+    let one: T = Int::one();
     loop {
         let n = f();
-        if n == minus_one && os::errno() == libc::EINTR as int { }
+        if n == -one && os::errno() == libc::EINTR as int { }
         else { return n }
     }
 }