diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-04-25 18:21:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-25 17:21:52 +0000 |
| commit | 156893d774b4da5b541fdbb08428f9ec392949a0 (patch) | |
| tree | 9185d94384aa62eb6eb099ddc4ca9408df6f90d1 /src/command/event.rs | |
| parent | Add to Cargo.toml (diff) | |
| download | atuin-156893d774b4da5b541fdbb08428f9ec392949a0.zip | |
Update docs, unify on SQLx, bugfixes (#40)
* Begin moving to sqlx for local too
* Stupid scanners should just have a nice cup of tea
Random internet shit searching for /.env or whatever
* Remove diesel and rusqlite fully
Diffstat (limited to '')
| -rw-r--r-- | src/command/event.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/command/event.rs b/src/command/event.rs index b205be70..f09752d6 100644 --- a/src/command/event.rs +++ b/src/command/event.rs @@ -1,7 +1,7 @@ -use std::sync::mpsc; use std::thread; use std::time::Duration; +use crossbeam_channel::unbounded; use termion::event::Key; use termion::input::TermRead; @@ -13,7 +13,7 @@ pub enum Event<I> { /// A small event handler that wrap termion input and tick events. Each event /// type is handled in its own thread and returned to a common `Receiver` pub struct Events { - rx: mpsc::Receiver<Event<Key>>, + rx: crossbeam_channel::Receiver<Event<Key>>, } #[derive(Debug, Clone, Copy)] @@ -37,7 +37,7 @@ impl Events { } pub fn with_config(config: Config) -> Events { - let (tx, rx) = mpsc::channel(); + let (tx, rx) = unbounded(); { let tx = tx.clone(); @@ -62,7 +62,7 @@ impl Events { Events { rx } } - pub fn next(&self) -> Result<Event<Key>, mpsc::RecvError> { + pub fn next(&self) -> Result<Event<Key>, crossbeam_channel::RecvError> { self.rx.recv() } } |
