repak/examples/read.rs

16 lines
488 B
Rust
Raw Normal View History

2023-01-03 10:33:42 +00:00
fn main() -> Result<(), un_pak::Error> {
for version in un_pak::Version::iter().rev() {
match un_pak::Pak::new(
version,
std::io::BufReader::new(std::io::Cursor::new(include_bytes!("rando_p.pak"))),
) {
2023-01-03 10:33:42 +00:00
Ok(_) => {
println!("parsed successfully!");
return Ok(());
}
Err(e) => println!("{e}"),
}
}
2023-01-05 20:20:05 +00:00
Err(un_pak::Error::Other("no version can parse".to_string()))
2023-01-03 10:33:42 +00:00
}