Add rust lint CI job. (#9)
All checks were successful
Check / Check Rust (push) Successful in 20s

Additionally fix the many lint errors that are occurring. (or disable them).

Reviewed-on: #9
Co-authored-by: Drew Galbraith <drew@tiramisu.one>
Co-committed-by: Drew Galbraith <drew@tiramisu.one>
This commit is contained in:
Drew 2025-12-14 09:02:59 +00:00 committed by Drew
parent 311755c812
commit 1a48911745
30 changed files with 177 additions and 108 deletions

View file

@ -94,7 +94,7 @@ impl Ext2Driver {
/// Updates the cached inode tables to contain the inode table for
/// a specific group.
fn populate_inode_table_if_none(&mut self, block_group_num: usize) {
if let None = self.inode_table_map[block_group_num] {
if self.inode_table_map[block_group_num].is_none() {
debug!(
"Cache MISS on inode table for block_group {}",
block_group_num
@ -148,17 +148,15 @@ impl Ext2Driver {
let dbl_indr_block_mem =
MemoryRegion::from_cap(self.reader.read(block_num, 1).unwrap()).unwrap();
let dbl_indr_blocks: &[u32] = dbl_indr_block_mem.slice();
let dbl_indr_blocks: &[u32] = &dbl_indr_block_mem.slice()[0..num_dbl_indr];
let mut blocks_to_read = Vec::new();
for i in 0..num_dbl_indr {
for (i, dbl_indr_block) in dbl_indr_blocks.iter().enumerate() {
let num_blocks_in_single = min(num_blocks - (256 * i), 256);
blocks_to_read.append(
&mut self.get_blocks_from_single_indirect(
dbl_indr_blocks[i] as u64,
num_blocks_in_single,
),
&mut self
.get_blocks_from_single_indirect(*dbl_indr_block as u64, num_blocks_in_single),
);
}
@ -176,7 +174,7 @@ impl Ext2Driver {
let mut blocks = Vec::new();
while let Some(block) = iter.next() {
for block in iter {
if block as u64 == (curr_block.lba + curr_block.size) {
curr_block.size += 1;
} else {

View file

@ -111,7 +111,9 @@ pub struct Inode {
const _: () = assert!(size_of::<Inode>() == 128);
#[allow(dead_code)]
pub const EXT2_FT_FILE: u8 = 0x1;
#[allow(dead_code)]
pub const EXT2_FT_DIR: u8 = 0x2;
#[repr(C, packed)]