From a2ed3551eadc9bbfb0caab112d1670b9ba663187 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 1 Jan 2026 08:25:45 +0100 Subject: [PATCH 1/2] Fix new clippy unnecessary_unwrap warning error: called `unwrap` on `bytes_name` after checking its variant with `is_some` --> generator/src/generator/namespace/mod.rs:573:49 | 572 | if bytes_name.is_some() && field_size == union_size { | -------------------- the check is happening here 573 | outln!(out, "Self({})", bytes_name.unwrap()); | ^^^^^^^^^^^^^^^^^^^ | = help: try using `match` = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#unnecessary_unwrap = note: `-D clippy::unnecessary-unwrap` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::unnecessary_unwrap)]` Signed-off-by: Uli Schlachter --- generator/src/generator/namespace/mod.rs | 35 +++++++++++++----------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/generator/src/generator/namespace/mod.rs b/generator/src/generator/namespace/mod.rs index 1a2f019a..6e9b716e 100644 --- a/generator/src/generator/namespace/mod.rs +++ b/generator/src/generator/namespace/mod.rs @@ -569,25 +569,28 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> { out, ); let field_size = field.size().unwrap(); - if bytes_name.is_some() && field_size == union_size { - outln!(out, "Self({})", bytes_name.unwrap()); - } else { - outln!(out, "let value = ["); - for result_byte in result_bytes.iter() { - outln!(out.indent(), "{},", result_byte); + match bytes_name { + Some(bytes_name) if field_size == union_size => { + outln!(out, "Self({})", bytes_name); } - // This is needed to handle cases such as Behavior.type or - // Action.type from the XKB extension. - // - // FIXME: For those cases it might be better to omit the - // serialize implementation. - if field_size != union_size { - for _ in 0..(union_size - field_size) { - outln!(out.indent(), "0,"); + _ => { + outln!(out, "let value = ["); + for result_byte in result_bytes.iter() { + outln!(out.indent(), "{},", result_byte); + } + // This is needed to handle cases such as Behavior.type or + // Action.type from the XKB extension. + // + // FIXME: For those cases it might be better to omit the + // serialize implementation. + if field_size != union_size { + for _ in 0..(union_size - field_size) { + outln!(out.indent(), "0,"); + } } + outln!(out, "];"); + outln!(out, "Self(value)"); } - outln!(out, "];"); - outln!(out, "Self(value)"); } }); outln!(out, "}}"); From a9d96df556277d65a627cb37c3961676eeb84773 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 1 Jan 2026 08:33:31 +0100 Subject: [PATCH 2/2] Fix msrv-check: async-lock bumped its MSRV See https://github.com/smol-rs/async-lock/blob/master/CHANGELOG.md#version-342 Signed-off-by: Uli Schlachter --- .github/workflows/CI.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c159d319..4d17ff07 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -185,6 +185,8 @@ jobs: run: cargo update --package async-io --precise 2.5.0 - name: Pin last polling release supporting our msrv of Rust 1.68 run: cargo update --package polling --precise 3.10.0 + - name: Pin last async-lock release supporting our msrv of Rust 1.68 + run: cargo update --package async-lock --precise 3.4.1 # build - name: cargo check x11rb-protocol with all features