Skip to content

Added Fraction type

Added Fraction type #3

GitHub Actions / clippy succeeded Apr 14, 2024 in 0s

clippy

2 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 2
Note 0
Help 0

Versions

  • rustc 1.77.2 (25ef9e3d8 2024-04-09)
  • cargo 1.77.2 (e52e36006 2024-03-26)
  • clippy 0.1.77 (25ef9e3 2024-04-09)

Annotations

Check warning on line 53 in src/fractional.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this boolean expression can be simplified

warning: this boolean expression can be simplified
  --> src/fractional.rs:53:9
   |
53 |         !(self.denominator < 0 && self.numerator < 0) && self.denominator < 0 || self.numerator < 0
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
help: try
   |
53 |         !(self.denominator >= 0 || self.numerator < 0) || self.numerator < 0
   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53 |         self.denominator < 0 && self.numerator >= 0 || self.numerator < 0
   |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 53 in src/fractional.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this boolean expression can be simplified

warning: this boolean expression can be simplified
  --> src/fractional.rs:53:9
   |
53 |         !(self.denominator < 0 && self.numerator < 0) && self.denominator < 0 || self.numerator < 0
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
   = note: `#[warn(clippy::nonminimal_bool)]` on by default
help: try
   |
53 |         !(self.denominator >= 0 && self.numerator >= 0)
   |
53 |         self.denominator < 0 || self.numerator < 0
   |