Clean directory structure
This commit is contained in:
parent
ed5a26d88f
commit
fd6cdf4d7d
@ -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"
|
||||||
|
21
src/main.rs
21
src/main.rs
@ -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)?;
|
||||||
|
@ -1 +0,0 @@
|
|||||||
pub mod event;
|
|
Loading…
Reference in New Issue
Block a user