aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-12 15:49:32 -0500
committerJesse Luehrs <doy@tozt.net>2021-03-12 15:49:32 -0500
commiteb3f6dbccfc2f1c87ec3c38c78abc3337ceb3ccb (patch)
tree7d8bb1120cb437874022af574451819f563afc0a
parentf069116b8c71775b3a6c83c247608eabc9b6fec1 (diff)
downloadtextmode-eb3f6dbccfc2f1c87ec3c38c78abc3337ceb3ccb.tar.gz
textmode-eb3f6dbccfc2f1c87ec3c38c78abc3337ceb3ccb.zip
initialize input before output in example
this way we're sure that raw mode is enabled before data is sent (so programs that are waiting for input won't accidentally send data too early)
-rw-r--r--examples/async.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/async.rs b/examples/async.rs
index e8c88ba..52c1edb 100644
--- a/examples/async.rs
+++ b/examples/async.rs
@@ -24,8 +24,8 @@ async fn run(
fn main() {
smol::block_on(async {
- let mut tm = textmode::Output::new().await.unwrap();
let mut input = textmode::Input::new().await.unwrap();
+ let mut tm = textmode::Output::new().await.unwrap();
let e = run(&mut tm, &mut input).await;
e.unwrap();
});