Skip to content

Fix compiler error from Rust 1.87, pacify Clippy 1.88#1935

Merged
ImplOfAnImpl merged 1 commit into
masterfrom
rust_1_88_fixes
Jul 2, 2025
Merged

Fix compiler error from Rust 1.87, pacify Clippy 1.88#1935
ImplOfAnImpl merged 1 commit into
masterfrom
rust_1_88_fixes

Conversation

@ImplOfAnImpl

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread clippy.toml
disallowed-types = []
enforced-import-renames = []
large-error-threshold = 256
enum-variant-size-threshold = 256

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: for some reason Clippy started to complain about "large size difference between variants" for multiple enums, even though the default value for enum-variant-size-threshold doesn't seem to have changed between the compiler versions. I decided to set it to 256 explicitly, for consistency with large-error-threshold, this silenced the complaints.


// Decode and encode 1_048_576 chars 'X'
let result = Some(format!("!{:X<4194304}!", ""));
let result = Some(std::iter::repeat_n('X', 1_048_576).collect::<String>());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: this was a hard error (probably since 1.87, the version I've skipped) - integer out of range for u16 in format string

Comment thread test/runner/functional.rs
let possible_python_execs = ["python3", "python"];

let file_suffix = (env::consts::OS == "windows").then_some(".exe").unwrap_or_default();
let file_suffix = if env::consts::OS == "windows" {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: the complaint was:

error: this method chain can be written more clearly with `if .. else ..`
  --> test/runner/functional.rs:73:23
   |
73 |     let file_suffix = (env::consts::OS == "windows").then_some(".exe").unwrap_or_default();
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if env::consts::OS == "windows" { ".exe" } else { Default::default() }`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#obfuscated_if_else
   = note: `-D clippy::obfuscated-if-else` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::obfuscated_if_else)]`

Same for the similar changes in the wallet.

@ImplOfAnImpl ImplOfAnImpl merged commit 9f94040 into master Jul 2, 2025
18 checks passed
@ImplOfAnImpl ImplOfAnImpl deleted the rust_1_88_fixes branch July 2, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants