Skip to content

Instantly share code, notes, and snippets.

@pitkley
Created December 10, 2017 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pitkley/c581f612225688937cc8b7f3a7deff9a to your computer and use it in GitHub Desktop.
Save pitkley/c581f612225688937cc8b7f3a7deff9a to your computer and use it in GitHub Desktop.
cross issue #52
$ echo hello | cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running `/target/debug/stdinout`
LINE: Ok("hello")
$ cross -V
cross 0.1.14
cargo 0.25.0-nightly (930f9d949 2017-12-05)
$ echo hello | cross run
the input device is not a TTY
$ # install cross without `-t` flag set
$ cross -V
cross 0.1.15-dev (974d8c6 2017-12-10)
cargo 0.25.0-nightly (930f9d949 2017-12-05)
$ echo hello | cross run
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running `/target/debug/stdinout`
LINE: Ok("hello")
use std::io::{self, BufRead};
fn main() {
let stdin = io::stdin();
for line in stdin.lock().lines() {
println!("LINE: {:?}", line);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment