Skip to content

fix(mining): make sure the age reset only happens when the previous b… #98

fix(mining): make sure the age reset only happens when the previous b…

fix(mining): make sure the age reset only happens when the previous b… #98

GitHub Actions / clippy failed Jun 14, 2024 in 1s

clippy

19 errors

Details

Results

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

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b9 2024-06-10)

Annotations

Check failure on line 332 in data_structures/src/transaction_factory.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/transaction_factory.rs:332:69
    |
332 |                     .map(|o| o.checked_total_value().unwrap_or(u64::max_value()))
    |                                                                     ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
332 |                     .map(|o| o.checked_total_value().unwrap_or(u64::MAX))
    |                                                                     ~~~

Check failure on line 329 in data_structures/src/transaction_factory.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/transaction_factory.rs:329:29
    |
329 |             .unwrap_or(u64::max_value())
    |                             ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
329 |             .unwrap_or(u64::MAX)
    |                             ~~~

Check failure on line 303 in data_structures/src/proto/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/proto/mod.rs:303:49
    |
303 |             pb <= Self::ProtoStruct::from(Self::max_value()),
    |                                                 ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
303 |             pb <= Self::ProtoStruct::from(Self::MAX),
    |                                                 ~~~

Check failure on line 289 in data_structures/src/proto/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/proto/mod.rs:289:49
    |
289 |             pb <= Self::ProtoStruct::from(Self::max_value()),
    |                                                 ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
289 |             pb <= Self::ProtoStruct::from(Self::MAX),
    |                                                 ~~~

Check failure on line 275 in data_structures/src/proto/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/proto/mod.rs:275:49
    |
275 |             pb <= Self::ProtoStruct::from(Self::max_value()),
    |                                                 ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
275 |             pb <= Self::ProtoStruct::from(Self::MAX),
    |                                                 ~~~

Check failure on line 332 in data_structures/src/transaction_factory.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/transaction_factory.rs:332:69
    |
332 |                     .map(|o| o.checked_total_value().unwrap_or(u64::max_value()))
    |                                                                     ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
332 |                     .map(|o| o.checked_total_value().unwrap_or(u64::MAX))
    |                                                                     ~~~

Check failure on line 329 in data_structures/src/transaction_factory.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/transaction_factory.rs:329:29
    |
329 |             .unwrap_or(u64::max_value())
    |                             ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
329 |             .unwrap_or(u64::MAX)
    |                             ~~~

Check failure on line 303 in data_structures/src/proto/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/proto/mod.rs:303:49
    |
303 |             pb <= Self::ProtoStruct::from(Self::max_value()),
    |                                                 ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
303 |             pb <= Self::ProtoStruct::from(Self::MAX),
    |                                                 ~~~

Check failure on line 289 in data_structures/src/proto/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/proto/mod.rs:289:49
    |
289 |             pb <= Self::ProtoStruct::from(Self::max_value()),
    |                                                 ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
289 |             pb <= Self::ProtoStruct::from(Self::MAX),
    |                                                 ~~~

Check failure on line 275 in data_structures/src/proto/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
   --> data_structures/src/proto/mod.rs:275:49
    |
275 |             pb <= Self::ProtoStruct::from(Self::max_value()),
    |                                                 ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
275 |             pb <= Self::ProtoStruct::from(Self::MAX),
    |                                                 ~~~

Check failure on line 6439 in data_structures/src/chain/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
    --> data_structures/src/chain/mod.rs:6439:57
     |
6439 |         assert_eq!(rep_engine.threshold_factor(9), u32::max_value());
     |                                                         ^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
     |
6439 |         assert_eq!(rep_engine.threshold_factor(9), u32::MAX);
     |                                                         ~~~

Check failure on line 6372 in data_structures/src/chain/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
    --> data_structures/src/chain/mod.rs:6372:58
     |
6372 |         assert_eq!(rep_engine.threshold_factor(10), u32::max_value());
     |                                                          ^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
     |
6372 |         assert_eq!(rep_engine.threshold_factor(10), u32::MAX);
     |                                                          ~~~

Check failure on line 6266 in data_structures/src/chain/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
    --> data_structures/src/chain/mod.rs:6266:57
     |
6266 |         assert_eq!(rep_engine.threshold_factor(1), u32::max_value());
     |                                                         ^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
     |
6266 |         assert_eq!(rep_engine.threshold_factor(1), u32::MAX);
     |                                                         ~~~

Check failure on line 4504 in data_structures/src/chain/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
    --> data_structures/src/chain/mod.rs:4504:38
     |
4504 |             .filter(|&x| x <= Epoch::max_value() as Epoch)
     |                                      ^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
     |
4504 |             .filter(|&x| x <= Epoch::MAX as Epoch)
     |                                      ~~~

Check failure on line 4406 in data_structures/src/chain/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
    --> data_structures/src/chain/mod.rs:4406:10
     |
4406 |     u32::max_value()
     |          ^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
     |
4406 |     u32::MAX
     |          ~~~

Check failure on line 4402 in data_structures/src/chain/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
    --> data_structures/src/chain/mod.rs:4402:57
     |
4402 |             return u32::try_from(factor).unwrap_or(u32::max_value());
     |                                                         ^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
     = note: `-D clippy::legacy-numeric-constants` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::legacy_numeric_constants)]`
help: use the associated constant instead
     |
4402 |             return u32::try_from(factor).unwrap_or(u32::MAX);
     |                                                         ~~~

Check failure on line 4504 in data_structures/src/chain/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
    --> data_structures/src/chain/mod.rs:4504:38
     |
4504 |             .filter(|&x| x <= Epoch::max_value() as Epoch)
     |                                      ^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
     |
4504 |             .filter(|&x| x <= Epoch::MAX as Epoch)
     |                                      ~~~

Check failure on line 4406 in data_structures/src/chain/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
    --> data_structures/src/chain/mod.rs:4406:10
     |
4406 |     u32::max_value()
     |          ^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
     |
4406 |     u32::MAX
     |          ~~~

Check failure on line 4402 in data_structures/src/chain/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

error: usage of a legacy numeric method
    --> data_structures/src/chain/mod.rs:4402:57
     |
4402 |             return u32::try_from(factor).unwrap_or(u32::max_value());
     |                                                         ^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
     = note: `-D clippy::legacy-numeric-constants` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::legacy_numeric_constants)]`
help: use the associated constant instead
     |
4402 |             return u32::try_from(factor).unwrap_or(u32::MAX);
     |                                                         ~~~