1 2 3 4 5 6 7 8 9 10 11 12 13
use snap; use std::io; fn main() { let stdin = io::stdin(); let stdout = io::stdout(); let mut rdr = stdin.lock(); // Wrap the stdout writer in a Snappy writer. let mut wtr = snap::write::FrameEncoder::new(stdout.lock()); io::copy(&mut rdr, &mut wtr).expect("I/O operation failed"); }