A pipe filter is a program to drop between unix pipes: source | filter | sink . I'd like for it to do as little buffering as possible, and to process things as they come, rather than reading everything and only starting to process data on EOF .

I'm very new to Rust, and this is a learning project. The whole pipe filter thing is meant to be scaffolding for me to play with string processing on the commandline, and arises from the need to get unsanitized JSON from conky and cleaning it up for i3bar.

Here's what I have. It doesn't do any processing, and should just dump stdin to stdout.

I'm unsure whether read_line() will block until a newline character is found, and how to check whether it returned something I can work with. I know it returns an IoResult , but I haven't been able to find out how to do a match against it. It seems the try! macro is used in this context, but I'm not sure how.

When it reaches the sleep() call, it appears to sleep indefinitely.