From 8aac863368589a114b64cb1affeff7afa3c33218 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Mon, 3 Aug 2026 10:00:26 -0600 Subject: [PATCH 1/3] Update toolchain to 1.95.0 Signed-off-by: Tim Crawford --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index fea6f0e..24d8b67 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.85.0" +channel = "1.95.0" targets = ["x86_64-unknown-uefi"] profile = "minimal" From 6dee70a2dcd5be71fe8446f26ea232d34b7150a8 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Mon, 3 Aug 2026 10:01:41 -0600 Subject: [PATCH 2/3] Update deps Signed-off-by: Tim Crawford --- Cargo.lock | 38 +++++++++++++++++++++++--------------- Cargo.toml | 2 +- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 230c01a..b4957e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,15 +13,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "bitflags" -version = "2.10.0" +version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" [[package]] name = "downcast-rs" @@ -31,24 +31,25 @@ checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" [[package]] name = "libc" -version = "0.2.177" +version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "libm" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" -version = "0.1.10" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" +checksum = "2026a5056764a10b2bf5d56488cba40da507f5493a6a429340e2004d9ed085fa" dependencies = [ "bitflags", "libc", + "plain", "redox_syscall", ] @@ -63,10 +64,11 @@ dependencies = [ [[package]] name = "orbclient" -version = "0.3.49" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "247ad146e19b9437f8604c21f8652423595cf710ad108af40e77d3ae6e96b827" +checksum = "59aed3b33578edcfa1bc96a321d590d31832b6ad55a26f0313362ce687e9abd6" dependencies = [ + "libc", "libredox", ] @@ -90,6 +92,12 @@ dependencies = [ "ttf-parser", ] +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "redox_hwio" version = "0.1.6" @@ -98,9 +106,9 @@ checksum = "8eb516ad341a84372b5b15a5a35cf136ba901a639c8536f521b108253d7fce74" [[package]] name = "redox_syscall" -version = "0.5.18" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +checksum = "07507be7b4a5f9f26eeb41eeaebb1f5a7ff29dfb29739facc21d35bf8b11c21e" dependencies = [ "bitflags", ] @@ -144,7 +152,7 @@ dependencies = [ [[package]] name = "system76_ectool" version = "0.3.8" -source = "git+https://github.com/system76/ec.git#206165c51dec452ff8a53bd928b21f5ce309bcf2" +source = "git+https://github.com/system76/ec.git#ef05e145d554f4a4862258f582bbc309853ac606" dependencies = [ "downcast-rs", "redox_hwio", diff --git a/Cargo.toml b/Cargo.toml index eef724e..24d7bea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ license = "GPL-3.0-only" lto = true [dependencies] -orbclient = { version = "0.3.46", default-features = false } +orbclient = { version = "=0.3.51", default-features = false } orbfont = { version = "0.1.12", default-features = false, features = ["no-std"] } redox_uefi_std = "0.1.14" system76_ectool = { git = "https://github.com/system76/ec.git", default-features = false, features = ["redox_hwio"] } From 53789242d41a8e5c48f354676154ddbf75d5d440 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Mon, 3 Aug 2026 10:08:23 -0600 Subject: [PATCH 3/3] Address lints Address the following: - mismatched_lifetime_syntaxes - clippy::collapsible_if - clippy::collapsible_match - clippy::manual_div_ceil Signed-off-by: Tim Crawford --- src/fde.rs | 5 ++++- src/image/bmp.rs | 4 ++-- src/image/mod.rs | 2 +- src/security.rs | 2 ++ src/ui.rs | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/fde.rs b/src/fde.rs index 89134e8..7a927ef 100644 --- a/src/fde.rs +++ b/src/fde.rs @@ -1,5 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-only +#![allow(clippy::collapsible_if)] +#![allow(clippy::collapsible_match)] + use core::{char, cmp, mem, ptr, slice}; use orbclient::{Color, Renderer}; use orbfont::Text; @@ -177,7 +180,7 @@ where pub struct ListHead(ListEntry); impl ListHead { - pub fn iter(&self) -> ListEntryIter { + pub fn iter(&self) -> ListEntryIter<'_, T> { let next = self.0.next(); ListEntryIter { start: next, diff --git a/src/image/bmp.rs b/src/image/bmp.rs index 8db9681..2bd24a7 100644 --- a/src/image/bmp.rs +++ b/src/image/bmp.rs @@ -35,8 +35,8 @@ pub fn parse(file_data: &[u8]) -> core::result::Result { let height = getd(0x16); let depth = getw(0x1C) as u32; - let bytes = (depth + 7) / 8; - let row_bytes = (depth * width + 31) / 32 * 4; + let bytes = depth.div_ceil(8); + let row_bytes = (depth * width).div_ceil(32) * 4; let mut blue_mask = 0xFF; let mut green_mask = 0xFF00; diff --git a/src/image/mod.rs b/src/image/mod.rs index ba883de..c6b2d42 100644 --- a/src/image/mod.rs +++ b/src/image/mod.rs @@ -79,7 +79,7 @@ impl Image { } /// Get a piece of the image - pub fn roi(&self, x: u32, y: u32, w: u32, h: u32) -> ImageRoi { + pub fn roi(&self, x: u32, y: u32, w: u32, h: u32) -> ImageRoi<'_> { let x1 = cmp::min(x, self.width()); let y1 = cmp::min(y, self.height()); let x2 = cmp::max(x1, cmp::min(x + w, self.width())); diff --git a/src/security.rs b/src/security.rs index 6f663ef..206582a 100644 --- a/src/security.rs +++ b/src/security.rs @@ -192,6 +192,7 @@ pub(crate) fn confirm(display: &mut Display) -> Result<()> { } Key::Character(c) => match c { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' => { + #[allow(clippy::collapsible_match)] if input.len() < code.len() { input.push(c); } @@ -216,6 +217,7 @@ pub(crate) fn confirm(display: &mut Display) -> Result<()> { input.clear(); } Key::Down => { + #[allow(clippy::collapsible_match)] if button_i + 1 < buttons.len() { button_i += 1; } diff --git a/src/ui.rs b/src/ui.rs index 4cfe0c1..ce7f5f8 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -90,7 +90,7 @@ impl Ui { } //TODO: move to orbfont and optimize - pub fn render_text_wrapped(&self, string: &str, font_size: f32, width: u32) -> Vec { + pub fn render_text_wrapped(&self, string: &str, font_size: f32, width: u32) -> Vec> { let mut texts = Vec::new(); //TODO: support different whitespace differently, like newline?