sigpipe 0.1.1

A single function call to reset SIGPIPE and fix `failed printing to stdout`
Documentation

pipefix

The default Rust runtime panics when println! and family write to a closed pipe. pipefix fixes it with a single function call invoked at the start of your program.

Usage


fn main() {
    sigpipe::reset();
    // The rest of your program goes here.
}

Installation

# Using cargo-edit
cargo add pipefix

# In your Cargo.toml
[dependencies]
pipefix = "0.1"

Discussion

There have been several discussions about this issue. See:

Acknowledgments

This library is directly copied from @burntsushi's StackOverflow answer.

I made this library to package the solution, so users don't have to hunt for it online.