aboutsummaryrefslogtreecommitdiff
path: root/vendor/anstream/examples/query-stream.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/anstream/examples/query-stream.rs')
-rw-r--r--vendor/anstream/examples/query-stream.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/anstream/examples/query-stream.rs b/vendor/anstream/examples/query-stream.rs
new file mode 100644
index 0000000..fe0af95
--- /dev/null
+++ b/vendor/anstream/examples/query-stream.rs
@@ -0,0 +1,20 @@
+fn main() {
+ println!("stdout:");
+ println!(
+ " choice: {:?}",
+ anstream::AutoStream::choice(&std::io::stdout())
+ );
+ println!(
+ " choice: {:?}",
+ anstream::AutoStream::auto(std::io::stdout()).current_choice()
+ );
+ println!("stderr:");
+ println!(
+ " choice: {:?}",
+ anstream::AutoStream::choice(&std::io::stderr())
+ );
+ println!(
+ " choice: {:?}",
+ anstream::AutoStream::auto(std::io::stderr()).current_choice()
+ );
+}