Skip to content

Commit

Permalink
[skip ci] Use Rust 1.53.0 for tool checks (rustfmt, clippy, and `…
Browse files Browse the repository at this point in the history
…tarpaulin`).
  • Loading branch information
iliekturtles committed Jul 13, 2021
1 parent 1a09530 commit c444a83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-tool-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
toolchain:
- 1.49.0
- 1.53.0

steps:
- name: Checkout repository
Expand Down
17 changes: 6 additions & 11 deletions src/si/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,13 @@ mod tests {
}

fn test_try_from(t: Result<Duration, TryFromError>, v: A<V>) -> TestResult {
if *v < V::zero() {
return TestResult::discard();
}
println!("*v: {:?}: t: {:?}, u128: {:?}", *v, t, v.to_u128());

let ok = match (t, v.to_u64()) {
(Ok(t), Some(u)) => {
let d = Duration::from_nanos(u);
let r = if d > t { d - t } else { t - d };

Duration::from_nanos(1) >= r
},
(Err(_), None) => true,
let ok = match (t, v.to_u128()) {
(Ok(t), Some(u)) => t.as_nanos() == u,
(Err(TryFromError::NegativeDuration), _) if *v < V::zero() => true,
(Err(TryFromError::Overflow), None) => true,
(_, None) => true,
_ => false,
};

Expand Down

0 comments on commit c444a83

Please sign in to comment.