diff --git a/docs/WASI-tutorial.md b/docs/WASI-tutorial.md index 2c5cc84bba..8a01ce5f19 100644 --- a/docs/WASI-tutorial.md +++ b/docs/WASI-tutorial.md @@ -121,14 +121,14 @@ use std::io::{Read, Write}; fn process(input_fname: &str, output_fname: &str) -> Result<(), String> { let mut input_file = - fs::File::open(input_fname).map_err(|err| format!("error opening input: {}", err))?; + fs::File::open(input_fname).map_err(|err| format!("error opening input {}: {}", input_fname, err))?; let mut contents = Vec::new(); input_file .read_to_end(&mut contents) .map_err(|err| format!("read error: {}", err))?; let mut output_file = fs::File::create(output_fname) - .map_err(|err| format!("error opening output '{}': {}", output_fname, err))?; + .map_err(|err| format!("error opening output {}: {}", output_fname, err))?; output_file .write_all(&contents) .map_err(|err| format!("write error: {}", err)) @@ -139,7 +139,7 @@ fn main() { let program = args[0].clone(); if args.len() < 3 { - eprintln!("{} ", program); + eprintln!("usage: {} ", program); return; }