diff options
author | cc <cc@localhost> | 2025-08-20 19:56:24 -0700 |
---|---|---|
committer | cc <cc@localhost> | 2025-08-20 19:57:14 -0700 |
commit | a7ded0a844feac401be72a5b575cb0e0c3e12e01 (patch) | |
tree | 7d2d48b6258c23a633d18eab9784f8dc1c47d8a2 /src/binfile.rs | |
parent | 238a3e31a8fb0eb24de278b9286b9b6caef1c66b (diff) |
Standardize Label Structures
Compress processed masks to simple labels
Dump simple labels to file
Diffstat (limited to 'src/binfile.rs')
-rw-r--r-- | src/binfile.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/binfile.rs b/src/binfile.rs index a43f568..5b0b783 100644 --- a/src/binfile.rs +++ b/src/binfile.rs @@ -12,3 +12,16 @@ pub fn dump_u32_vec(file_name: &str, data: Vec<u32>) -> Result<(), Error> { } Ok(()) } + +pub fn dump_u16_vec(file_name: &str, data: Vec<u16>) -> Result<(), Error> { + use std::fs::File; + use std::io::Write; + if let Ok(mut file) = File::create(file_name) { + for value in data { + file.write_all(&value.to_le_bytes())?; + } + } else { + return Err(Error::new(ErrorKind::Other, "Error creating file")); + } + Ok(()) +} |