Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wgreenberg committed Nov 28, 2024
1 parent 10424d3 commit d528c4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion rust/noclip-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use syn::{Attribute, Data, Path};
use syn::Data;
use quote::quote;

#[proc_macro_derive(FromStructPerField, attributes(from))]
Expand Down
13 changes: 4 additions & 9 deletions rust/src/unity/asset_file.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use deku::{bitvec::{BitSlice, BitVec}, prelude::*};
use deku::bitvec::BitSlice;
use deku::{DekuContainerRead, DekuRead};
use wasm_bindgen::prelude::*;

use crate::unity::types::common::{NullTerminatedAsciiString, UnityArray};
use crate::unity::types::wasm::WasmFriendlyPPtr;
use crate::unity::types::class_id::ClassID;
use crate::unity::types::serialized_file::{SerializedFileHeader, SerializedFileMetadata};
Expand Down Expand Up @@ -41,7 +41,6 @@ impl AssetFile {
// data will be the file from bytes 0..data_offset, so skip to where the metadata starts
let bitslice = BitSlice::from_slice(data);
let (rest, _) = SerializedFileHeader::read(&bitslice, ()).unwrap();
let header_len = data.len() - rest.len() / 8;
match SerializedFileMetadata::read(rest, self.header.version) {
Ok((_, metadata)) => self.metadata = Some(metadata),
Err(err) => return Err(format!("failed to parse metadata: {:?}", err)),
Expand Down Expand Up @@ -106,21 +105,17 @@ pub struct AssetFileObject {

#[cfg(test)]
mod tests {
use std::collections::{HashMap, HashSet};
use std::path::PathBuf;
use std::str::FromStr;

use crate::unity::types::common::UnityVersion;
use crate::unity::types::wasm::{GameObject, Texture2D, Mesh, MeshFilter, MeshRenderer, Transform, Material};
use crate::unity::types::serialized_file::ObjectInfo;
use crate::unity::types::wasm::{Texture2D, Mesh, MeshFilter, MeshRenderer, Transform, Material};

use super::*;
use env_logger;
use deku::bitvec::BitVec;

#[test]
fn test() {
let mut base_path = PathBuf::from_str("C:\\Users\\ifnsp\\dev\\noclip.website\\data\\AShortHike").unwrap();
let base_path = PathBuf::from_str("C:\\Users\\ifnsp\\dev\\noclip.website\\data\\AShortHike").unwrap();
let data = std::fs::read(&base_path.join("resources.assets")).unwrap();
let version = UnityVersion::V2021_3_27f1;
let mut asset_file = AssetFile::initialize_with_header_chunk(&data).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion rust/src/unity/types/binary.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use deku::{bitvec::{BitSlice, Msb0}, prelude::*};
use deku::prelude::*;

// https://github.com/AssetRipper/TypeTreeDumps/blob/main/StructsDump/release/2019.4.39f1.dump
// e.g. Outer Wilds
Expand Down

0 comments on commit d528c4d

Please sign in to comment.