mirror of
https://codeberg.org/icewind/vdf-reader.git
synced 2026-06-03 10:04:08 +02:00
init
This commit is contained in:
commit
f492a63ab1
19 changed files with 1885 additions and 0 deletions
16
examples/table.rs
Normal file
16
examples/table.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
use miette::{Context, IntoDiagnostic, Result};
|
||||
use std::env::args;
|
||||
use std::fs::read_to_string;
|
||||
use vdf_reader::entry::Table;
|
||||
use vdf_reader::Reader;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let path = args().nth(1).expect("no path provided");
|
||||
let raw = read_to_string(path)
|
||||
.into_diagnostic()
|
||||
.wrap_err("failed to read input")?;
|
||||
let mut reader = Reader::from(raw.as_str());
|
||||
let table = Table::load(&mut reader).wrap_err("failed to parse into")?;
|
||||
dbg!(table);
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue