Skip to content

Commit 44780c3

Browse files
authored
Merge pull request #968 from psychon/fix-ci
Fix CI: Deal with a new clippy warning and pin a dependency which bumped its MSRV
2 parents b9847ff + a9d96df commit 44780c3

File tree

2 files changed

+21
-16
lines changed
  • .github/workflows
  • generator/src/generator/namespace

2 files changed

+21
-16
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ jobs:
185185
run: cargo update --package async-io --precise 2.5.0
186186
- name: Pin last polling release supporting our msrv of Rust 1.68
187187
run: cargo update --package polling --precise 3.10.0
188+
- name: Pin last async-lock release supporting our msrv of Rust 1.68
189+
run: cargo update --package async-lock --precise 3.4.1
188190

189191
# build
190192
- name: cargo check x11rb-protocol with all features

generator/src/generator/namespace/mod.rs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -569,25 +569,28 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
569569
out,
570570
);
571571
let field_size = field.size().unwrap();
572-
if bytes_name.is_some() && field_size == union_size {
573-
outln!(out, "Self({})", bytes_name.unwrap());
574-
} else {
575-
outln!(out, "let value = [");
576-
for result_byte in result_bytes.iter() {
577-
outln!(out.indent(), "{},", result_byte);
572+
match bytes_name {
573+
Some(bytes_name) if field_size == union_size => {
574+
outln!(out, "Self({})", bytes_name);
578575
}
579-
// This is needed to handle cases such as Behavior.type or
580-
// Action.type from the XKB extension.
581-
//
582-
// FIXME: For those cases it might be better to omit the
583-
// serialize implementation.
584-
if field_size != union_size {
585-
for _ in 0..(union_size - field_size) {
586-
outln!(out.indent(), "0,");
576+
_ => {
577+
outln!(out, "let value = [");
578+
for result_byte in result_bytes.iter() {
579+
outln!(out.indent(), "{},", result_byte);
580+
}
581+
// This is needed to handle cases such as Behavior.type or
582+
// Action.type from the XKB extension.
583+
//
584+
// FIXME: For those cases it might be better to omit the
585+
// serialize implementation.
586+
if field_size != union_size {
587+
for _ in 0..(union_size - field_size) {
588+
outln!(out.indent(), "0,");
589+
}
587590
}
591+
outln!(out, "];");
592+
outln!(out, "Self(value)");
588593
}
589-
outln!(out, "];");
590-
outln!(out, "Self(value)");
591594
}
592595
});
593596
outln!(out, "}}");

0 commit comments

Comments
 (0)