use async_std::{prelude::*,fs::File,io}; type Error = Box; type R = Box; #[async_std::main] async fn main() -> Result<(),Error> { let args = std::env::args().collect::>(); let infile: R = match args.get(1).unwrap_or(&"-".into()).as_str() { "-" => Box::new(io::stdin()), x => Box::new(File::open(x).await?), }; let mut stream = o5m_stream::decode(infile); while let Some(result) = stream.next().await { let r = result?; println!["{:?}", r]; } Ok(()) }