Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.85.0"
channel = "1.95.0"
targets = ["x86_64-unknown-uefi"]
profile = "minimal"
5 changes: 4 additions & 1 deletion src/fde.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -177,7 +180,7 @@ where
pub struct ListHead<T>(ListEntry<T>);

impl<T> ListHead<T> {
pub fn iter(&self) -> ListEntryIter<T> {
pub fn iter(&self) -> ListEntryIter<'_, T> {
let next = self.0.next();
ListEntryIter {
start: next,
Expand Down
4 changes: 2 additions & 2 deletions src/image/bmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ pub fn parse(file_data: &[u8]) -> core::result::Result<Image, String> {
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;
Expand Down
2 changes: 1 addition & 1 deletion src/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
2 changes: 2 additions & 0 deletions src/security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Text> {
pub fn render_text_wrapped(&self, string: &str, font_size: f32, width: u32) -> Vec<Text<'_>> {
let mut texts = Vec::new();

//TODO: support different whitespace differently, like newline?
Expand Down
Loading