Files
Sylpheed/crates/sylpheed-formats/examples/gp_title_entry_names.rs
MechaCat02 62376dd4a1 style: rustfmt sweep — 107 files the lint gate never saw
This branch predates CI on `main`. `cargo fmt --all` only; no behaviour.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 16:34:40 +02:00

25 lines
866 B
Rust

use std::path::PathBuf;
use sylpheed_formats::{pak::PakArchive, ui_layout};
fn main() {
let root = PathBuf::from(std::env::var("SYLPHEED_DISC").unwrap());
let ar = PakArchive::open(root.join("dat/GP_TITLE.pak")).unwrap();
for (i, e) in ar.entries().iter().enumerate() {
let Ok(by) = ar.read(e) else {
println!("{i:2} <unreadable>");
continue;
};
let names: Vec<String> = ui_layout::parse_build(&by)
.map(|b| b.sprites.keys().take(2).cloned().collect())
.unwrap_or_default();
let rec: Vec<String> = ui_layout::parse_build(&by)
.map(|b| b.records.keys().take(2).cloned().collect())
.unwrap_or_default();
println!(
"{i:2} {} B sprites {:?} records {:?}",
by.len(),
names,
rec
);
}
}