M Cargo.lock => Cargo.lock +1 -1
@@ 4,7 4,7 @@ version = 3
[[package]]
name = "flatiron"
-version = "1.0.2"
+version = "1.0.4"
dependencies = [
"nom",
]
M src/main.rs => src/main.rs +9 -2
@@ 1,5 1,5 @@
use flatiron::convert;
-use std::io::Read;
+use std::io::{Read, Write};
fn main() {
let mut textile = String::new();
@@ 8,5 8,12 @@ fn main() {
eprintln!("Something went wrong while reading stdin.")
}
let html = convert(textile);
- print!("{}", html);
+ let mut stdout = std::io::stdout();
+
+ let res = write!(stdout, "{}", html);
+ if let Err(ref e) = res {
+ if e.kind() != std::io::ErrorKind::BrokenPipe {
+ res.unwrap();
+ }
+ }
}