From c814426905a82cadf13e36c421dd571fdbaea016 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 9 Jul 2023 09:11:56 +0200 Subject: [PATCH] Fix(squas): Hi! --- src/accounts/mod.rs | 3 ++- src/app/event.rs | 19 ++++++++++++------- src/app/mod.rs | 9 ++++----- src/app/status.rs | 3 ++- src/ui/mod.rs | 17 +++++++---------- 5 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/accounts/mod.rs b/src/accounts/mod.rs index 624868c..f273104 100644 --- a/src/accounts/mod.rs +++ b/src/accounts/mod.rs @@ -1,3 +1,5 @@ +use std::fs; + use anyhow::{Error, Result}; use cli_log::{error, info, warn}; use matrix_sdk::{ @@ -6,7 +8,6 @@ use matrix_sdk::{ Client, Session, }; use serde::{Deserialize, Serialize}; -use std::fs; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Account { diff --git a/src/app/event.rs b/src/app/event.rs index 8f004aa..9d0c8bc 100644 --- a/src/app/event.rs +++ b/src/app/event.rs @@ -1,8 +1,3 @@ -use crate::app::{ - status::{State, Status}, - App, -}; -use crate::ui; use anyhow::{Error, Result}; use cli_log::{error, info, warn}; use matrix_sdk::{ @@ -14,10 +9,20 @@ use matrix_sdk::{ }, Client, LoopCtrl, }; -use tokio::sync::{broadcast, mpsc}; -use tokio::time::Duration; +use tokio::{ + sync::{broadcast, mpsc}, + time::Duration, +}; use tokio_util::sync::CancellationToken; +use crate::{ + app::{ + status::{State, Status}, + App, + }, + ui, +}; + #[derive(Debug)] pub enum EventStatus { Ok, diff --git a/src/app/mod.rs b/src/app/mod.rs index a57cf08..6b14863 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1,11 +1,9 @@ pub mod event; pub mod status; -use crate::accounts; -use crate::ui; +use std::path::Path; -use accounts::Account; -use accounts::AccountsManager; +use accounts::{Account, AccountsManager}; use anyhow::{Error, Result}; use cli_log::{error, info, warn}; use matrix_sdk::{ @@ -19,13 +17,14 @@ use matrix_sdk::{ Client, }; use status::{State, Status}; -use std::path::Path; use tokio::{ sync::{broadcast, mpsc}, time::{sleep, Duration}, }; use tokio_util::sync::CancellationToken; +use crate::{accounts, ui}; + pub struct App<'a> { ui: ui::UI<'a>, accounts_manager: accounts::AccountsManager, diff --git a/src/app/status.rs b/src/app/status.rs index 4a175ba..6b2d3fc 100644 --- a/src/app/status.rs +++ b/src/app/status.rs @@ -1,3 +1,5 @@ +use std::any::Any; + use anyhow::{Error, Result}; use cli_log::{error, info, warn}; use indexmap::IndexMap; @@ -9,7 +11,6 @@ use matrix_sdk::{ }, Client, }; -use std::any::Any; pub enum State { None, diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 92f2253..f5b8a2a 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -1,4 +1,4 @@ -use crate::app::status::Status; +use std::{cmp, io, io::Stdout}; use anyhow::{Error, Result}; use cli_log::{error, info, warn}; @@ -12,21 +12,18 @@ use matrix_sdk::{ room::MessagesOptions, ruma::events::{AnyMessageLikeEvent, AnyTimelineEvent}, }; -use std::cmp; -use std::io; -use std::io::Stdout; -use tui::layout::{Alignment, Corner}; -use tui::style::{Color, Modifier, Style}; -use tui::text::{Span, Spans, Text}; -use tui::widgets::{List, ListItem, ListState, Paragraph, Wrap}; use tui::{ backend::CrosstermBackend, - layout::{Constraint, Direction, Layout}, - widgets::{Block, Borders, Widget}, + 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, }; use tui_textarea::{Input, Key, TextArea}; +use crate::app::status::Status; + #[derive(Clone, Copy)] pub enum SetupInputPosition { Homeserver,