17 lines
409 B
Rust
17 lines
409 B
Rust
use anyhow::{Context as _, Result};
|
|
use std::str::FromStr as _;
|
|
|
|
fn main() -> Result<()> {
|
|
let mut args = std::env::args();
|
|
args.next().unwrap();
|
|
|
|
let path = args
|
|
.next()
|
|
.context("Usage: cargo run --example file -- untracked/data.xml")?;
|
|
let s = std::fs::read_to_string(&path)?;
|
|
let dwml = weather_dot_gov_rs::Dwml::from_str(&s)?;
|
|
|
|
println!("{dwml:#?}");
|
|
Ok(())
|
|
}
|