material dump

This commit is contained in:
Robin Appelman 2023-12-12 18:45:48 +01:00
commit c625fa85eb
2 changed files with 5 additions and 0 deletions

View file

@ -30,3 +30,6 @@ steamy-vdf = { version = "0.3.0", git = "https://github.com/icewind1991/steamy",
[profile.dev.package."*"]
opt-level = 2
[features]
dump_materials = []

View file

@ -118,6 +118,8 @@ pub fn load_material(
}
fn parse_vdf(bytes: &[u8]) -> Result<Table, Error> {
#[cfg(feature = "dump_materials")]
println!("{}", String::from_utf8_lossy(bytes));
let mut reader = steamy_vdf::Reader::from(bytes);
Table::load(&mut reader).map_err(|e| {
error!(