From 60493f8234b5817cd091a98918e9404209ec033e Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 28 Apr 2025 22:46:11 -0400 Subject: [PATCH] Remove custom string map functions in fiin parser --- src/fiin.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fiin.rs b/src/fiin.rs index ce6ead9..2d22229 100644 --- a/src/fiin.rs +++ b/src/fiin.rs @@ -5,6 +5,7 @@ use std::fs::read; use std::io::Cursor; use std::path::Path; +use crate::common_file_operations::{read_string, write_string}; use crate::{ByteBuffer, ByteSpan}; use binrw::binrw; use binrw::{BinRead, BinWrite}; @@ -42,8 +43,8 @@ pub struct FIINEntry { #[brw(pad_before = 4)] #[br(count = 64)] #[bw(pad_size_to = 64)] - #[bw(map = |x : &String | x.as_bytes())] - #[br(map = | x: Vec | String::from_utf8(x).unwrap().trim_matches(char::from(0)).to_string())] + #[bw(map = write_string)] + #[br(map = read_string)] pub file_name: String, /// SHA1 of the file