1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-05-05 18:27:46 +00:00

Remove custom string map functions in fiin parser

This commit is contained in:
Joshua Goins 2025-04-28 22:46:11 -04:00
parent b7ab90e811
commit 60493f8234

View file

@ -5,6 +5,7 @@ use std::fs::read;
use std::io::Cursor; use std::io::Cursor;
use std::path::Path; use std::path::Path;
use crate::common_file_operations::{read_string, write_string};
use crate::{ByteBuffer, ByteSpan}; use crate::{ByteBuffer, ByteSpan};
use binrw::binrw; use binrw::binrw;
use binrw::{BinRead, BinWrite}; use binrw::{BinRead, BinWrite};
@ -42,8 +43,8 @@ pub struct FIINEntry {
#[brw(pad_before = 4)] #[brw(pad_before = 4)]
#[br(count = 64)] #[br(count = 64)]
#[bw(pad_size_to = 64)] #[bw(pad_size_to = 64)]
#[bw(map = |x : &String | x.as_bytes())] #[bw(map = write_string)]
#[br(map = | x: Vec<u8> | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())] #[br(map = read_string)]
pub file_name: String, pub file_name: String,
/// SHA1 of the file /// SHA1 of the file