rustc/vendor/bstr/examples/uppercase-std.rs
2020-03-25 15:04:31 +01:00

16 lines
396 B
Rust

use std::error::Error;
use std::io::{self, BufRead, Write};
fn main() -> Result<(), Box<Error>> {
let stdin = io::stdin();
let mut stdin = stdin.lock();
let mut stdout = io::BufWriter::new(io::stdout());
let mut line = String::new();
while stdin.read_line(&mut line)? > 0 {
stdout.write_all(line.to_uppercase().as_bytes())?;
line.clear();
}
Ok(())
}