Skip to content

Moved to using checked arithmetic for Amounts. #351

Moved to using checked arithmetic for Amounts.

Moved to using checked arithmetic for Amounts. #351

Triggered via push June 29, 2023 17:08
Status Failure
Total duration 17m 44s
Artifacts
This run and associated checks have been archived and are scheduled for deletion. Learn more about checks retention

ci.yml

on: push
Matrix: build
Matrix: test
Fit to window
Zoom out
Zoom in

Annotations

7 errors
Rustfmt
Process completed with exit code 1.
Nightly lint
The process '/home/runner/.cargo/bin/cargo' failed with exit code 1
this expression creates a reference which is immediately dereferenced by the compiler: masp_primitives/src/transaction/components/amount.rs#L341
error: this expression creates a reference which is immediately dereferenced by the compiler --> masp_primitives/src/transaction/components/amount.rs:341:69 | 341 | comps.insert(atype.clone(), self.get(atype).checked_sub(&amount).expect("overflow detected")); | ^^^^^^^ help: change this to: `amount` | = note: `-D clippy::needless-borrow` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
use of `unwrap_or` followed by a call to `default`: masp_primitives/src/transaction/components/amount.rs#L100
error: use of `unwrap_or` followed by a call to `default` --> masp_primitives/src/transaction/components/amount.rs:100:47 | 100 | let val = self.0.get(&index).copied().unwrap_or(Magnitude::default()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()` | = note: `-D clippy::or-fun-call` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
this expression creates a reference which is immediately dereferenced by the compiler: masp_primitives/src/transaction/components/amount.rs#L341
error: this expression creates a reference which is immediately dereferenced by the compiler --> masp_primitives/src/transaction/components/amount.rs:341:69 | 341 | comps.insert(atype.clone(), self.get(atype).checked_sub(&amount).expect("overflow detected")); | ^^^^^^^ help: change this to: `amount` | = note: `-D clippy::needless-borrow` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
use of `unwrap_or` followed by a call to `default`: masp_primitives/src/transaction/components/amount.rs#L100
error: use of `unwrap_or` followed by a call to `default` --> masp_primitives/src/transaction/components/amount.rs:100:47 | 100 | let val = self.0.get(&index).copied().unwrap_or(Magnitude::default()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()` | = note: `-D clippy::or-fun-call` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
Lint
Clippy had exited with the 101 exit code