chore: clean up use statements

This commit is contained in:
Anna 2021-08-20 03:49:24 -04:00
parent 79437deb17
commit bb8a694b49
6 changed files with 39 additions and 27 deletions

View File

@ -3,13 +3,17 @@ use twitch_api2::{
types::UserId,
twitch_oauth2::UserToken,
};
use irc::client::prelude::Message;
use irc::proto::{Command, Response};
use crate::app::State;
use crate::app::config::CommandExecutor;
use crate::app::rhai_tools::ExecutorState;
use std::sync::Arc;
use irc::{
client::prelude::Message,
proto::{Command, Response},
};
use tokio_tungstenite::tungstenite::Message as WsMessage;
use crate::app::{
State,
config::CommandExecutor,
rhai_tools::ExecutorState,
};
use std::sync::Arc;
pub struct Twitch {
pub client: TwitchClient<'static, reqwest::Client>,

View File

@ -1,13 +1,17 @@
mod template;
mod route;
use std::sync::Arc;
use crate::app::State;
use warp::{Filter, Rejection, Reply};
use std::convert::Infallible;
use warp::http::StatusCode;
use std::borrow::Cow;
use warp::{
Filter, Rejection, Reply,
http::StatusCode,
};
use self::route::*;
use crate::app::State;
use std::{
borrow::Cow,
convert::Infallible,
sync::Arc,
};
pub async fn start_web(state: Arc<State>) {
let cookie_state = Arc::clone(&state);

View File

@ -1,3 +1,4 @@
use chrono::Duration;
use warp::{Filter, Reply, filters::BoxedFilter, http::Uri, Rejection};
use crate::app::{
State,
@ -10,10 +11,9 @@ use crate::app::{
use std::{
collections::HashMap,
convert::Infallible,
str::FromStr,
sync::Arc,
};
use std::str::FromStr;
use chrono::Duration;
pub fn commands_routes(state: Arc<State>) -> BoxedFilter<(impl Reply, )> {
warp::get()

View File

@ -1,4 +1,7 @@
use twitch_api2::types::RewardId;
use twitch_api2::{
helix::points::{GetCustomRewardRequest, CustomReward},
types::RewardId,
};
use warp::{
Filter, Reply,
filters::BoxedFilter,
@ -9,7 +12,7 @@ use crate::app::{
config::Redemption,
web::{
CustomRejection,
template::redemptions::{RedemptionsTemplate, AddRedemptionTemplate},
template::redemptions::{RedemptionsTemplate, AddRedemptionTemplate, ListRedemptionsTemplate},
},
};
use std::{
@ -17,8 +20,6 @@ use std::{
convert::Infallible,
sync::Arc,
};
use twitch_api2::helix::points::{GetCustomRewardRequest, CustomReward};
use crate::app::web::template::redemptions::ListRedemptionsTemplate;
pub fn redemptions_routes(state: Arc<State>) -> BoxedFilter<(impl Reply, )> {
warp::get()

View File

@ -1,6 +1,6 @@
use askama::Template;
use crate::app::config::Redemption;
use twitch_api2::helix::points::CustomReward;
use crate::app::config::Redemption;
#[derive(Template)]
#[template(path = "redemptions.html")]

View File

@ -1,19 +1,22 @@
#![feature(try_blocks)]
#![feature(drain_filter)]
#![feature(try_blocks, drain_filter)]
mod app;
use tokio::runtime::{Builder, Handle};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use futures::FutureExt;
use tokio::{
fs::OpenOptions,
io::{AsyncReadExt, AsyncWriteExt},
runtime::{Builder, Handle},
};
use crate::app::{
State,
config::Config,
user_config::UserConfig,
};
use std::path::Path;
use tokio::fs::OpenOptions;
use futures::FutureExt;
use std::sync::Arc;
use std::{
path::Path,
sync::Arc,
};
fn main() -> anyhow::Result<()> {
let runtime = Builder::new_multi_thread()