From 20be391b9ef2c1578ed9bd37b9608a24fd664bd9 Mon Sep 17 00:00:00 2001 From: Soispha Date: Mon, 10 Jul 2023 21:02:01 +0200 Subject: [PATCH] Style(treewide): Remove unneeded imports --- src/accounts/mod.rs | 8 ++------ src/app/event.rs | 23 +++++------------------ src/app/mod.rs | 18 +++--------------- src/app/status.rs | 4 +--- src/main.rs | 2 -- src/ui/mod.rs | 16 ++++++---------- 6 files changed, 17 insertions(+), 54 deletions(-) diff --git a/src/accounts/mod.rs b/src/accounts/mod.rs index f273104..2119f3e 100644 --- a/src/accounts/mod.rs +++ b/src/accounts/mod.rs @@ -1,12 +1,8 @@ use std::fs; use anyhow::{Error, Result}; -use cli_log::{error, info, warn}; -use matrix_sdk::{ - config::SyncSettings, - ruma::{events::room::message::SyncRoomMessageEvent, exports::serde_json, user_id}, - Client, Session, -}; +use cli_log::{error, info}; +use matrix_sdk::{ruma::exports::serde_json, Client, Session}; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/src/app/event.rs b/src/app/event.rs index b2ce11b..b7d14b6 100644 --- a/src/app/event.rs +++ b/src/app/event.rs @@ -1,26 +1,13 @@ use anyhow::{Error, Result}; -use cli_log::{error, info, warn}; + use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; -use matrix_sdk::{ - config::SyncSettings, - room::Room, - ruma::events::room::{ - member::StrippedRoomMemberEvent, - message::{MessageType, OriginalSyncRoomMessageEvent, RoomMessageEventContent}, - }, - Client, LoopCtrl, -}; -use tokio::{ - sync::{broadcast, mpsc}, - time::Duration, -}; +use matrix_sdk::{config::SyncSettings, Client, LoopCtrl}; +use tokio::{sync::mpsc, time::Duration}; + use tokio_util::sync::CancellationToken; use crate::{ - app::{ - status::{State, Status}, - App, - }, + app::{status::State, App}, ui, }; diff --git a/src/app/mod.rs b/src/app/mod.rs index 6b14863..93b3795 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -5,22 +5,10 @@ use std::path::Path; use accounts::{Account, AccountsManager}; use anyhow::{Error, Result}; -use cli_log::{error, info, warn}; -use matrix_sdk::{ - config::SyncSettings, - event_handler::Ctx, - room::Room, - ruma::events::room::{ - member::StrippedRoomMemberEvent, - message::{MessageType, OriginalSyncRoomMessageEvent, RoomMessageEventContent}, - }, - Client, -}; +use cli_log::info; +use matrix_sdk::Client; use status::{State, Status}; -use tokio::{ - sync::{broadcast, mpsc}, - time::{sleep, Duration}, -}; +use tokio::sync::mpsc; use tokio_util::sync::CancellationToken; use crate::{accounts, ui}; diff --git a/src/app/status.rs b/src/app/status.rs index 7247ba9..063c20c 100644 --- a/src/app/status.rs +++ b/src/app/status.rs @@ -1,7 +1,5 @@ -use std::any::Any; - use anyhow::{Error, Result}; -use cli_log::{error, info, warn}; +use cli_log::{warn, info}; use indexmap::IndexMap; use matrix_sdk::{ room::MessagesOptions, diff --git a/src/main.rs b/src/main.rs index aa926e4..0a46ccc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,8 +2,6 @@ mod accounts; mod app; mod ui; -use cli_log::{error, info, warn}; - #[tokio::main] async fn main() -> anyhow::Result<()> { cli_log::init_cli_log!(); diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 636f1fc..67ebd18 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -1,26 +1,22 @@ use std::{cmp, io, io::Stdout}; use anyhow::{Error, Result}; -use cli_log::{error, info, warn}; +use cli_log::info; use crossterm::{ - event::{self, read, DisableMouseCapture, EnableMouseCapture, Event}, + event::{DisableMouseCapture, EnableMouseCapture}, execute, - style::style, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; -use matrix_sdk::{ - room::MessagesOptions, - ruma::events::{AnyMessageLikeEvent, AnyTimelineEvent}, -}; +use matrix_sdk::ruma::events::{AnyMessageLikeEvent, AnyTimelineEvent}; use tui::{ backend::CrosstermBackend, layout::{Alignment, Constraint, Corner, Direction, Layout}, style::{Color, Modifier, Style}, text::{Span, Spans, Text}, - widgets::{Block, Borders, List, ListItem, ListState, Paragraph, Widget, Wrap}, - Frame, Terminal, + widgets::{Block, Borders, List, ListItem, ListState, Paragraph}, + Terminal, }; -use tui_textarea::{Input, Key, TextArea}; +use tui_textarea::TextArea; use crate::app::status::Status;