INNER CODE UNIT · Rust
Err
atanunq/viu · src/app.rs:32
if let Err(e) = execute!(stdout(), Clear(ClearType::FromCursorDown)) {
if e.kind() == ErrorKind::BrokenPipe {
//Do nothing. Output is probably piped to `head` or a similar tool
} else {
panic!("{}", e);
}
}
std::process::exit(0);
})
.map_err(|_| Error::other("Could not setup Ctrl-C handler."))?;
//TODO: handle multiple files
//read stdin if only one parameter is passed and it is "-"
if conf.files.len() == 1 && conf.files[0] == "-" {
let stdin = stdin();
let mut handle = stdin.lock();
let mut buf: Vec<u8> = Vec::new();