Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/app/cmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl CmosOptionTable {
let hi = u16::from(self.cmos.read(Self::CHECKSUM_OFFSET));
let lo = u16::from(self.cmos.read(Self::CHECKSUM_OFFSET + 1));

hi << 8 | lo
(hi << 8) | lo
}

/// Write the checksum to the CMOS option table.
Expand Down
4 changes: 2 additions & 2 deletions src/app/ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ impl<T: Timeout> SpiLegacy<T> {

unsafe fn read(&mut self, data: &mut [u8]) -> core::result::Result<(), ectool::Error> {
let block_size = self.block_size();
let blocks = (data.len() + block_size - 1) / block_size;
let blocks = data.len().div_ceil(block_size);
for block in 0..blocks {
unsafe {
self.pmc_cmd(0x03)?;
Expand All @@ -427,7 +427,7 @@ impl<T: Timeout> SpiLegacy<T> {

unsafe fn write(&mut self, data: &[u8]) -> core::result::Result<(), ectool::Error> {
let block_size = self.block_size();
let blocks = (data.len() + block_size - 1) / block_size;
let blocks = data.len().div_ceil(block_size);
for block in 0..blocks {
unsafe {
self.pmc_cmd(0x02)?;
Expand Down
4 changes: 2 additions & 2 deletions src/app/pci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::prelude::*;
use std::uefi::guid;

#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
struct Rsdp {
signature: [u8; 8], // b"RSD PTR "
chksum: u8,
Expand All @@ -21,7 +21,7 @@ struct Rsdp {
}

#[allow(dead_code)]
#[repr(packed)]
#[repr(C, packed)]
struct SdtHeader {
signature: [u8; 4],
length: u32,
Expand Down
2 changes: 1 addition & 1 deletion src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl<'a> ScaledDisplay<'a> {
}
}

impl<'a> Renderer for ScaledDisplay<'a> {
impl Renderer for ScaledDisplay<'_> {
fn width(&self) -> u32 {
self.display.width() / self.scale
}
Expand Down
2 changes: 1 addition & 1 deletion src/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct ImageRoi<'a> {
image: &'a Image,
}

impl<'a> ImageRoi<'a> {
impl ImageRoi<'_> {
/// Draw the ROI on a window
pub fn draw<R: Renderer>(&self, renderer: &mut R, x: i32, mut y: i32) {
let stride = self.image.w;
Expand Down