mirror of
https://github.com/Xithrius/twitch-tui.git
synced 2024-09-11 05:35:26 +03:00
Reorganized code, allowing dead structure attributes.
This commit is contained in:
parent
a63a6ed401
commit
a4aa58f72f
@ -1,9 +1,7 @@
|
||||
use std::sync::mpsc::Sender;
|
||||
|
||||
use dotenv;
|
||||
use futures::prelude::*;
|
||||
use irc::client::prelude::*;
|
||||
use tokio;
|
||||
|
||||
#[tokio::main]
|
||||
pub async fn twitch_irc(tx: &Sender<Vec<String>>) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
use std::io;
|
||||
use std::sync::mpsc;
|
||||
use std::sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
atomic::{AtomicBool, Ordering},
|
||||
};
|
||||
use std::sync::mpsc;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
@ -15,8 +15,12 @@ pub enum Event<I> {
|
||||
Tick,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct Events {
|
||||
rx: mpsc::Receiver<Event<Key>>,
|
||||
input_handle: thread::JoinHandle<()>,
|
||||
ignore_exit_key: Arc<AtomicBool>,
|
||||
tick_handle: thread::JoinHandle<()>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
@ -35,10 +39,6 @@ impl Default for Config {
|
||||
}
|
||||
|
||||
impl Events {
|
||||
pub fn new() -> Events {
|
||||
Events::with_config(Config::default())
|
||||
}
|
||||
|
||||
pub fn with_config(config: Config) -> Events {
|
||||
let (tx, rx) = mpsc::channel();
|
||||
let ignore_exit_key = Arc::new(AtomicBool::new(false));
|
||||
|
Loading…
Reference in New Issue
Block a user