Notice that there is a bug here: If the output is small enough to delay flushing the BufWriter until the (implicit) drop at the end of the scope, the BufWriter might fail for whatever reason to write to the underlying, yet its destructor will silently discard the error.
https://github.com/BurntSushi/xsv/blob/4278b8593260bb2e9bfdf6e91cc4df5b7df5b8fb/src/cmd/index.rs#L55-L58
Notice that there is a bug here: If the output is small enough to delay flushing the
BufWriter
until the (implicit)drop
at the end of the scope, theBufWriter
might fail for whatever reason to write to the underlying, yet its destructor will silently discard the error.