Skip to content

Commit

Permalink
fix(codestyle): remove unnecesary Result wrap from test return value
Browse files Browse the repository at this point in the history
type
  • Loading branch information
quasiyoke committed Feb 16, 2021
1 parent 240bd42 commit 25b429c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
`fixnum` adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Method `FixedPoint::into_bits` (@KalitaAlexey).

## [0.3.0] - 2021-01-25
### Removed
Expand Down
10 changes: 5 additions & 5 deletions examples/usage.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use derive_more::From;
use fixnum::{impl_op, typenum::U9, FixedPoint};

type FP = FixedPoint<i64, U9>;
type Fp = FixedPoint<i64, U9>;

#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, From)]
struct Size(i32);
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, From)]
struct Price(FP);
struct Price(Fp);
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, From)]
struct PriceDelta(FP);
struct PriceDelta(Fp);
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, From)]
struct Amount(FP);
struct Amount(Fp);
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord, From)]
struct Ratio(FP);
struct Ratio(Fp);

impl_op!(Size [cadd] Size = Size);
impl_op!(Size [csub] Size = Size);
Expand Down
4 changes: 1 addition & 3 deletions src/tests/fp128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,11 @@ fn rdiv_round() -> Result<()> {
}

#[test]
fn rdiv_division_by_zero() -> Result<()> {
fn rdiv_division_by_zero() {
assert_eq!(
FixedPoint::MAX.rdiv(FixedPoint::ZERO, Ceil),
Err(ArithmeticError::DivisionByZero)
);

Ok(())
}

#[test]
Expand Down
4 changes: 1 addition & 3 deletions src/tests/fp64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,11 @@ fn rdiv_round() -> Result<()> {
}

#[test]
fn rdiv_division_by_zero() -> Result<()> {
fn rdiv_division_by_zero() {
assert_eq!(
FixedPoint::MAX.rdiv(FixedPoint::ZERO, Ceil),
Err(ArithmeticError::DivisionByZero)
);

Ok(())
}

#[test]
Expand Down

0 comments on commit 25b429c

Please sign in to comment.