Clean directory structure

This commit is contained in:
Austen Adler 2021-05-14 21:26:55 -04:00
parent ed5a26d88f
commit fd6cdf4d7d
4 changed files with 10 additions and 20 deletions

View File

@ -7,16 +7,8 @@ readme = "README.adoc"
keywords = ["tui", "cli", "rpn"] keywords = ["tui", "cli", "rpn"]
categories = ["command-line-utilities"] categories = ["command-line-utilities"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
# Linux only
# tui = "0.14"
# termion = "1.5"
# Windows support
crossterm = "0.18" crossterm = "0.18"
tui = { version = "0.14", default-features = false, features = ['crossterm'] } tui = { version = "0.14", default-features = false, features = ['crossterm'] }
serde = {version = "1.0", features = ["derive"]} serde = {version = "1.0", features = ["derive"]}
confy = "0.4.0" confy = "0.4.0"

View File

@ -2,24 +2,23 @@
#![allow(dead_code)] #![allow(dead_code)]
mod calc; mod calc;
mod event;
mod format; mod format;
mod util;
use util::event::{Event, Events};
use calc::constants::{CalculatorDisplayMode, CalculatorState, RegisterState}; use calc::{
use calc::errors::CalculatorResult; constants::{CalculatorDisplayMode, CalculatorState, RegisterState},
use calc::Calculator; errors::CalculatorResult,
Calculator,
};
use crossterm::{ use crossterm::{
event::{DisableMouseCapture, KeyCode, KeyEvent, KeyModifiers}, event::{DisableMouseCapture, KeyCode, KeyEvent, KeyModifiers},
execute, execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
}; };
use io::stdout; use event::{Event, Events};
use std::cmp; // use io::stdout;
use std::convert::TryFrom;
use std::io::Write;
use std::{error::Error, io}; use std::{cmp, convert::TryFrom, error::Error, io, io::Write};
use tui::{ use tui::{
backend::CrosstermBackend, backend::CrosstermBackend,
layout::{Constraint, Direction, Layout}, layout::{Constraint, Direction, Layout},
@ -277,7 +276,7 @@ impl App {
fn main() -> Result<(), Box<dyn Error>> { fn main() -> Result<(), Box<dyn Error>> {
enable_raw_mode()?; enable_raw_mode()?;
let mut stdout = stdout(); let mut stdout = io::stdout();
execute!(stdout, EnterAlternateScreen, DisableMouseCapture)?; execute!(stdout, EnterAlternateScreen, DisableMouseCapture)?;
let backend = CrosstermBackend::new(stdout); let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend)?; let mut terminal = Terminal::new(backend)?;

View File

@ -1 +0,0 @@
pub mod event;