diff --git a/src/main.rs b/src/main.rs index 23dcddb..ebad22a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ use std::{ collections::HashMap, error::Error, - io::{self, Read}, + io::{self, Read, Write}, }; use bstr::ByteSlice; @@ -15,7 +15,9 @@ struct Args { #[arg(short, long)] count: usize, // TODO: higher-order chains + // TODO: save chains } +// long-term TODO: live up to name :P // use bstr because we don't give a cr*p about utf-8! fn main() -> Result<(), Box<dyn Error>> { @@ -26,6 +28,8 @@ fn main() -> Result<(), Box<dyn Error>> { // printing the first word immediately gives an intuitive idea of how long freq construction takes print!("{first_word} "); + // (we need to manually flush to have the intended effect) + io::stdout().flush()?; let mut buf = Vec::with_capacity(1 << 16); io::stdin().read_to_end(&mut buf)?;