Skip to content

Commit

Permalink
pass-through the implementation of is_zero instead of comparing to ze…
Browse files Browse the repository at this point in the history
…ro manually.

also test is_zero.
  • Loading branch information
radix committed Dec 23, 2017
1 parent ecaab25 commit 3fa3c46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ macro_rules! system {
}

fn is_zero(&self) -> bool {
self.value == V::zero()
self.value.is_zero()
}
}

Expand Down
1 change: 1 addition & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ mod system_macro {
fn zero() {
let z = Length::zero();
assert_eq!(z.value, 0.0);
assert!(z.is_zero())
}

quickcheck! {
Expand Down

0 comments on commit 3fa3c46

Please sign in to comment.