diff --git a/Cargo.toml b/Cargo.toml index 6b61691..055590f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,16 +7,8 @@ readme = "README.adoc" keywords = ["tui", "cli", "rpn"] categories = ["command-line-utilities"] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] -# Linux only -# tui = "0.14" -# termion = "1.5" - -# Windows support crossterm = "0.18" tui = { version = "0.14", default-features = false, features = ['crossterm'] } - serde = {version = "1.0", features = ["derive"]} confy = "0.4.0" diff --git a/src/util/event.rs b/src/event.rs similarity index 100% rename from src/util/event.rs rename to src/event.rs diff --git a/src/main.rs b/src/main.rs index 9501458..1c7f952 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,24 +2,23 @@ #![allow(dead_code)] mod calc; +mod event; mod format; -mod util; -use util::event::{Event, Events}; -use calc::constants::{CalculatorDisplayMode, CalculatorState, RegisterState}; -use calc::errors::CalculatorResult; -use calc::Calculator; +use calc::{ + constants::{CalculatorDisplayMode, CalculatorState, RegisterState}, + errors::CalculatorResult, + Calculator, +}; use crossterm::{ event::{DisableMouseCapture, KeyCode, KeyEvent, KeyModifiers}, execute, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; -use io::stdout; -use std::cmp; -use std::convert::TryFrom; -use std::io::Write; +use event::{Event, Events}; +// use io::stdout; -use std::{error::Error, io}; +use std::{cmp, convert::TryFrom, error::Error, io, io::Write}; use tui::{ backend::CrosstermBackend, layout::{Constraint, Direction, Layout}, @@ -277,7 +276,7 @@ impl App { fn main() -> Result<(), Box> { enable_raw_mode()?; - let mut stdout = stdout(); + let mut stdout = io::stdout(); execute!(stdout, EnterAlternateScreen, DisableMouseCapture)?; let backend = CrosstermBackend::new(stdout); let mut terminal = Terminal::new(backend)?; diff --git a/src/util/mod.rs b/src/util/mod.rs deleted file mode 100644 index 53f1126..0000000 --- a/src/util/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod event;