aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/test.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-08-11 14:19:23 +0000
committerBlaž Hrastnik2020-08-11 14:19:23 +0000
commit4733afa6c2c2b41d70b2d76748b4feb374b0ba77 (patch)
tree937a9572b5416e04c3323a8b98ad9cc3077677bf /helix-term/src/test.rs
parent8681d472928ff3d91508e11deda19b16c4694446 (diff)
Update dependencies.
smol 0.3 makes setup a whole lot easier.
Diffstat (limited to 'helix-term/src/test.rs')
-rw-r--r--helix-term/src/test.rs28
1 files changed, 2 insertions, 26 deletions
diff --git a/helix-term/src/test.rs b/helix-term/src/test.rs
index 12b4f377..181a3ee0 100644
--- a/helix-term/src/test.rs
+++ b/helix-term/src/test.rs
@@ -42,7 +42,7 @@ async fn print_events() {
if event == Event::Key(KeyCode::Char('c').into()) {
println!("Cursor position: {:?}\r", position());
-
+
}
println!("test");
@@ -67,32 +67,8 @@ fn main() -> Result<()> {
let mut stdout = stdout();
execute!(stdout, EnableMouseCapture)?;
- use std::thread;
-
- // Same number of threads as there are CPU cores.
- let num_threads = num_cpus::get().max(1);
-
- // A channel that sends the shutdown signal.
- let (s, r) = piper::chan::<()>(0);
- let mut threads = Vec::new();
-
- // Create an executor thread pool.
- for _ in 0..num_threads {
- // Spawn an executor thread that waits for the shutdown signal.
- let r = r.clone();
- threads.push(thread::spawn(move || smol::run(r.recv())));
- }
-
// No need to `run()`, now we can just block on the main future.
- smol::block_on(print_events());
-
- // Send a shutdown signal.
- drop(s);
-
- // Wait for threads to finish.
- for t in threads {
- t.join().unwrap();
- }
+ smol::run(print_events());
execute!(stdout, DisableMouseCapture)?;