Skip to content

Commit

Permalink
rust-1.83: Fix issues due to new compiler version
Browse files Browse the repository at this point in the history
The compiler now generates panics in a few places that it would know how
to handle previously.

Signed-off-by: Arthur Heymans <arthur.heymans@9elements.com>
  • Loading branch information
ArthurHeymans committed Dec 19, 2024
1 parent b30a409 commit f7a922e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 13 additions & 2 deletions drivers/src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,19 @@ impl uDisplay for HexBytes<'_> {
where
W: uWrite + ?Sized,
{
for byte in self.0.iter() {
ufmt::uwrite!(f, "{:02X}", *byte)?;
for &x in self.0.iter() {
let c = x >> 4;
if c < 10 {
f.write_char((c + b'0') as char)?;
} else {
f.write_char((c - 10 + b'A') as char)?;
}
let c = x & 0xf;
if c < 10 {
f.write_char((c + b'0') as char)?;
} else {
f.write_char((c - 10 + b'A') as char)?;
}
}
Ok(())
}
Expand Down
6 changes: 5 additions & 1 deletion runtime/src/authorize_and_stash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ impl AuthorizeAndStashCmd {
.image_metadata_list
.binary_search_by(|metadata| metadata.fw_id.cmp(&cmd_fw_id))
.ok()
.map(|index| &auth_manifest_image_metadata_col.image_metadata_list[index])
.map(|index| {
auth_manifest_image_metadata_col
.image_metadata_list
.get(index)
})?
}
}

0 comments on commit f7a922e

Please sign in to comment.