diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 70836f6..1625755 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -135,7 +135,7 @@ jobs: sudo apt-get -y install ${{ matrix.packages }} - name: Install cargo-zigbuild if: matrix.build == 'zigbuild' - run: pip install ziglang==0.10.1.post1 cargo-zigbuild==0.17.0 + run: pip install ziglang==0.11.0 cargo-zigbuild==0.18.3 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@nightly with: diff --git a/nod/src/disc/wii.rs b/nod/src/disc/wii.rs index fef3107..13b4470 100644 --- a/nod/src/disc/wii.rs +++ b/nod/src/disc/wii.rs @@ -6,7 +6,7 @@ use std::{ mem::size_of, }; -use sha1::{digest, Digest, Sha1}; +use sha1::{Digest, Sha1}; use zerocopy::{big_endian::*, AsBytes, FromBytes, FromZeroes}; use crate::{ diff --git a/nod/src/io/mod.rs b/nod/src/io/mod.rs index 54ec8fa..441d08a 100644 --- a/nod/src/io/mod.rs +++ b/nod/src/io/mod.rs @@ -2,8 +2,6 @@ use std::fmt; -use crate::{streams::ReadStream, Result}; - pub(crate) mod block; pub(crate) mod ciso; pub(crate) mod iso; @@ -22,19 +20,6 @@ pub(crate) type KeyBytes = [u8; 16]; /// Magic bytes pub(crate) type MagicBytes = [u8; 4]; -/// Abstraction over supported disc file formats. -pub trait DiscIO: Send + Sync { - /// Opens a new read stream for the disc file(s). - /// Generally does _not_ need to be used directly. - fn open(&self) -> Result>; - - /// Returns extra metadata included in the disc file format, if any. - fn meta(&self) -> Result { Ok(DiscMeta::default()) } - - /// If None, the file format does not store the original disc size. (e.g. WBFS, NFS) - fn disc_size(&self) -> Option; -} - #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub enum Format { /// Raw ISO diff --git a/nodtool/build.rs b/nodtool/build.rs index 94f0caf..a7b77fd 100644 --- a/nodtool/build.rs +++ b/nodtool/build.rs @@ -40,7 +40,7 @@ fn main() { let out_dir = env::var("OUT_DIR").unwrap(); let dest_path = Path::new(&out_dir).join("parsed-dats.bin"); - let mut f = BufWriter::new(File::create(&dest_path).unwrap()); + let mut f = BufWriter::new(File::create(dest_path).unwrap()); // Parse dat files let mut entries = Vec::<(GameEntry, String)>::new(); diff --git a/nodtool/src/main.rs b/nodtool/src/main.rs index 2313935..fe0a0f2 100644 --- a/nodtool/src/main.rs +++ b/nodtool/src/main.rs @@ -452,7 +452,7 @@ fn convert_and_verify(in_file: &Path, out_file: Option<&Path>, md5: bool) -> Res } let redump_entry = if let (Some(crc32), Some(sha1)) = (crc32, sha1) { - redump::find_by_hashes(crc32, sha1.into()) + redump::find_by_hashes(crc32, sha1) } else { None }; diff --git a/nodtool/src/redump.rs b/nodtool/src/redump.rs index 10d35e9..fc47f77 100644 --- a/nodtool/src/redump.rs +++ b/nodtool/src/redump.rs @@ -47,7 +47,7 @@ pub fn find_by_hashes(crc32: u32, sha1: [u8; 20]) -> Option { #[repr(C, align(4))] struct Aligned(T); -const DATA: &'static Aligned<[u8]> = +const DATA: &Aligned<[u8]> = &Aligned(*include_bytes!(concat!(env!("OUT_DIR"), "/parsed-dats.bin"))); // Keep in sync with build.rs