The automatic update PR had lint failures because Rust 1.82.0 wants a different syntax for type casts from u64 to u128.
error: casts from `u64` to `u128` can be expressed infallibly using `From`
--> rs/backend/src/tvl.rs:171:27
|
171 | let locked_u128 = state.total_locked_icp_e8s as u128;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: an `as` cast can become silently lossy if the types change in the future
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
= note: `-D clippy::cast-lossless` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]`
help: use `u128::from` instead
|
171 | let locked_u128 = u128::from(state.total_locked_icp_e8s);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Changes
Update Rust version to 1.82.0.
Update code to use u128::from syntax for casts from u64 to u128.
Tests
scripts/lint-rs passes again.
Todos
[ ] Add entry to changelog (if necessary).
not necessary
Motivation
The automatic update PR had lint failures because Rust 1.82.0 wants a different syntax for type casts from
u64
tou128
.Changes
u128::from
syntax for casts fromu64
tou128
.Tests
scripts/lint-rs
passes again.Todos