2025-05-03 20:06:35 +00:00
|
|
|
use anyhow::{Context as _, Result};
|
|
|
|
|
use std::str::FromStr as _;
|
|
|
|
|
|
|
|
|
|
fn main() -> Result<()> {
|
|
|
|
|
let mut args = std::env::args();
|
|
|
|
|
args.next().unwrap();
|
|
|
|
|
|
2025-05-03 21:47:28 +00:00
|
|
|
let path = args
|
|
|
|
|
.next()
|
|
|
|
|
.context("Usage: cargo run --example file -- untracked/data.xml")?;
|
2025-05-03 20:06:35 +00:00
|
|
|
let s = std::fs::read_to_string(&path)?;
|
|
|
|
|
let dwml = weather_dot_gov_rs::Dwml::from_str(&s)?;
|
|
|
|
|
|
|
|
|
|
println!("{dwml:#?}");
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|