diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-11-10 09:35:53 +1100 |
|---|---|---|
| committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-11-13 02:04:31 +1100 |
| commit | 46333d527b138e8e202380a5ce4409dfe1414148 (patch) | |
| tree | 12a9e363e31b019f74bcf9748fd2bc58770fd86d /src/libstd/sys/unix | |
| parent | 0da49dcf1352bc038bb32c1a7bc1ac1be50d541c (diff) | |
| download | rust-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.rs | 6 |
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 } } } |
