Resolve fmt & check issues

This commit is contained in:
Luke Street 2024-04-30 23:54:30 -06:00
parent f28238209d
commit 03b83484cb
3 changed files with 4 additions and 30 deletions

View File

@ -13,7 +13,7 @@ use crate::{
array_ref,
disc::{
gcn::{read_part_meta, PartitionGC},
PartitionBase, PartitionKind, PartitionMeta, SECTOR_SIZE,
PartitionBase, PartitionMeta, SECTOR_SIZE,
},
fst::{Node, NodeKind},
io::{
@ -70,18 +70,6 @@ impl WiiPartEntry {
pub(crate) fn offset(&self) -> u64 { (self.offset.get() as u64) << 2 }
}
#[derive(Debug, PartialEq)]
pub(crate) struct WiiPartInfo {
pub(crate) group_idx: u32,
pub(crate) part_idx: u32,
pub(crate) offset: u64,
pub(crate) kind: PartitionKind,
pub(crate) header: WiiPartitionHeader,
pub(crate) junk_id: [u8; 4],
pub(crate) junk_start: u64,
pub(crate) title_key: KeyBytes,
}
pub(crate) const WII_PART_GROUP_OFF: u64 = 0x40000;
#[derive(Debug, PartialEq, FromBytes, FromZeroes, AsBytes)]

View File

@ -1,13 +1,6 @@
mod argp_version;
use std::{
env,
error::Error,
ffi::OsStr,
fmt,
path::PathBuf,
str::FromStr,
};
use std::{env, error::Error, ffi::OsStr, fmt, path::PathBuf, str::FromStr};
use argp::{FromArgValue, FromArgs};
use enable_ansi_support::enable_ansi_support;

View File

@ -1,6 +1,6 @@
use std::{mem::size_of, str};
use nod::{array_ref, SECTOR_SIZE};
use nod::array_ref;
use zerocopy::{FromBytes, FromZeroes};
#[derive(Clone, Debug)]
@ -9,7 +9,6 @@ pub struct GameResult {
pub crc32: u32,
pub md5: [u8; 16],
pub sha1: [u8; 20],
pub size: u64,
}
pub fn find_by_crc32(crc32: u32) -> Option<GameResult> {
@ -30,13 +29,7 @@ pub fn find_by_crc32(crc32: u32) -> Option<GameResult> {
let offset = entry.string_table_offset as usize;
let name_size = u32::from_ne_bytes(*array_ref![string_table, offset, 4]) as usize;
let name = str::from_utf8(&string_table[offset + 4..offset + 4 + name_size]).unwrap();
Some(GameResult {
name,
crc32: entry.crc32,
md5: entry.md5,
sha1: entry.sha1,
size: entry.sectors as u64 * SECTOR_SIZE as u64,
})
Some(GameResult { name, crc32: entry.crc32, md5: entry.md5, sha1: entry.sha1 })
}
#[repr(C, align(4))]