mirror of https://github.com/encounter/nod-rs.git
Resolve fmt & check issues
This commit is contained in:
parent
f28238209d
commit
03b83484cb
|
@ -13,7 +13,7 @@ use crate::{
|
||||||
array_ref,
|
array_ref,
|
||||||
disc::{
|
disc::{
|
||||||
gcn::{read_part_meta, PartitionGC},
|
gcn::{read_part_meta, PartitionGC},
|
||||||
PartitionBase, PartitionKind, PartitionMeta, SECTOR_SIZE,
|
PartitionBase, PartitionMeta, SECTOR_SIZE,
|
||||||
},
|
},
|
||||||
fst::{Node, NodeKind},
|
fst::{Node, NodeKind},
|
||||||
io::{
|
io::{
|
||||||
|
@ -70,18 +70,6 @@ impl WiiPartEntry {
|
||||||
pub(crate) fn offset(&self) -> u64 { (self.offset.get() as u64) << 2 }
|
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;
|
pub(crate) const WII_PART_GROUP_OFF: u64 = 0x40000;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, FromBytes, FromZeroes, AsBytes)]
|
#[derive(Debug, PartialEq, FromBytes, FromZeroes, AsBytes)]
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
mod argp_version;
|
mod argp_version;
|
||||||
|
|
||||||
use std::{
|
use std::{env, error::Error, ffi::OsStr, fmt, path::PathBuf, str::FromStr};
|
||||||
env,
|
|
||||||
error::Error,
|
|
||||||
ffi::OsStr,
|
|
||||||
fmt,
|
|
||||||
path::PathBuf,
|
|
||||||
str::FromStr,
|
|
||||||
};
|
|
||||||
|
|
||||||
use argp::{FromArgValue, FromArgs};
|
use argp::{FromArgValue, FromArgs};
|
||||||
use enable_ansi_support::enable_ansi_support;
|
use enable_ansi_support::enable_ansi_support;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::{mem::size_of, str};
|
use std::{mem::size_of, str};
|
||||||
|
|
||||||
use nod::{array_ref, SECTOR_SIZE};
|
use nod::array_ref;
|
||||||
use zerocopy::{FromBytes, FromZeroes};
|
use zerocopy::{FromBytes, FromZeroes};
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
@ -9,7 +9,6 @@ pub struct GameResult {
|
||||||
pub crc32: u32,
|
pub crc32: u32,
|
||||||
pub md5: [u8; 16],
|
pub md5: [u8; 16],
|
||||||
pub sha1: [u8; 20],
|
pub sha1: [u8; 20],
|
||||||
pub size: u64,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn find_by_crc32(crc32: u32) -> Option<GameResult> {
|
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 offset = entry.string_table_offset as usize;
|
||||||
let name_size = u32::from_ne_bytes(*array_ref![string_table, offset, 4]) 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();
|
let name = str::from_utf8(&string_table[offset + 4..offset + 4 + name_size]).unwrap();
|
||||||
Some(GameResult {
|
Some(GameResult { name, crc32: entry.crc32, md5: entry.md5, sha1: entry.sha1 })
|
||||||
name,
|
|
||||||
crc32: entry.crc32,
|
|
||||||
md5: entry.md5,
|
|
||||||
sha1: entry.sha1,
|
|
||||||
size: entry.sectors as u64 * SECTOR_SIZE as u64,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[repr(C, align(4))]
|
#[repr(C, align(4))]
|
||||||
|
|
Loading…
Reference in New Issue