Skip to content

Commit ef93618

Browse files
committed
rust: update to toolchain 1.85.1
Saves ~4.5kB of binary space. Code changes are due to new clippy warnings.
1 parent d1ebf2c commit ef93618

File tree

337 files changed

+83068
-79786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+83068
-79786
lines changed

.containerversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
45
1+
46

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ RUN rustup target add thumbv7em-none-eabi
150150
RUN rustup component add rustfmt
151151
RUN rustup component add clippy
152152
RUN rustup component add rust-src
153-
RUN CARGO_HOME=/opt/cargo cargo install cbindgen --version 0.27.0 --locked
153+
RUN CARGO_HOME=/opt/cargo cargo install cbindgen --version 0.28.0 --locked
154154
RUN CARGO_HOME=/opt/cargo cargo install bindgen-cli --version 0.71.1 --locked
155155

156156
# Until cargo vendor supports vendoring dependencies of the rust std libs we

src/rust/bitbox02-rust/src/hww/api/cardano/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ fn address_header(params: &params::Params, script_config: &Config) -> u8 {
326326
Config::PkhSkh(_) => 0,
327327
};
328328

329-
address_tag << 4 | params.network_id
329+
(address_tag << 4) | params.network_id
330330
}
331331

332332
/// Encode the given address using bech32, validating that the keypaths are valid. If

src/rust/bitbox02-rust/src/hww/api/cardano/keypath.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn validate_address_shelley_payment(
6262
bip44_account: Option<u32>,
6363
) -> Result<(), Error> {
6464
if let &[BIP44_PURPOSE_SHELLEY, BIP44_COIN, account, role, address] = keypath {
65-
if !bip44_account.map_or(true, |a| a == account) {
65+
if bip44_account.is_some_and(|a| a != account) {
6666
return Err(Error);
6767
}
6868
check_account(account)?;
@@ -88,7 +88,7 @@ pub fn validate_address_shelley_stake(
8888
if let &[BIP44_PURPOSE_SHELLEY, BIP44_COIN, account, BIP44_STAKE_ROLE, BIP44_STAKE_ADDRESS] =
8989
keypath
9090
{
91-
if !bip44_account.map_or(true, |a| a == account) {
91+
if bip44_account.is_some_and(|a| a != account) {
9292
return Err(Error);
9393
}
9494
check_account(account)?;

src/rust/bitbox02-rust/src/hww/api/cardano/sign_transaction/cbor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub fn encode_withdrawal_address(
6363
let pubkey_hash = pubkey_hash_at_keypath(keypath)?;
6464
let mut encoded: Vec<u8> = Vec::with_capacity(1 + ADDRESS_HASH_SIZE);
6565
let address_tag = 0b1110; // reward address using a stake keyhash.
66-
let header = address_tag << 4 | params.network_id;
66+
let header = (address_tag << 4) | params.network_id;
6767
encoded.push(header);
6868
encoded.extend_from_slice(&pubkey_hash);
6969
Ok(encoded)

src/rust/erc20_params/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#![no_std]
1616

17-
#[repr(packed)]
17+
#[repr(Rust, packed)]
1818
struct P {
1919
// Null-terminated strings, saving a few bytes of binary space per token stored versus using
2020
// `&str`, which also stores the size of the string. We could further optimize for space by

src/rust/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.84.1"
2+
channel = "1.85.1"

src/rust/vendor/allocator-api2/.cargo-checksum.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/vendor/allocator-api2/Cargo.toml

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/vendor/allocator-api2/README.md

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/vendor/allocator-api2/src/lib.rs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/vendor/allocator-api2/src/nightly.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)