Skip to content

Commit

Permalink
style(cleanup): minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
imsnif committed Sep 23, 2020
1 parent bf4103f commit 674204f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 295 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Expand Up @@ -3,5 +3,3 @@ target/
vendor/
vendor.tar
**/*.rs.bk
.vscode
*.code-workspace
3 changes: 0 additions & 3 deletions src/input/controls.rs
Expand Up @@ -12,9 +12,6 @@ pub struct TerminalEvents;
impl Iterator for TerminalEvents {
type Item = Event;
fn next(&mut self) -> Option<Event> {
// note : these are all events not just kb
// resize comes here too

Some(read().unwrap())
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Expand Up @@ -77,7 +77,7 @@ fn try_main() -> Result<(), failure::Error> {
Ok(stdout) => {
enable_raw_mode()?;
let terminal_backend = CrosstermBackend::new(stdout);
let keyboard_events = TerminalEvents {};
let terminal_events = TerminalEvents {};
let folder = match opts.folder {
Some(folder) => folder,
None => env::current_dir()?,
Expand All @@ -87,7 +87,7 @@ fn try_main() -> Result<(), failure::Error> {
}
start(
terminal_backend,
Box::new(keyboard_events),
Box::new(terminal_events),
folder,
opts.apparent_size,
opts.disable_delete_confirmation,
Expand All @@ -101,7 +101,7 @@ fn try_main() -> Result<(), failure::Error> {

pub fn start<B>(
terminal_backend: B,
keyboard_events: Box<dyn Iterator<Item = BackEvent> + Send>,
terminal_events: Box<dyn Iterator<Item = BackEvent> + Send>,
path: PathBuf,
show_apparent_size: bool,
disable_delete_confirmation: bool,
Expand Down Expand Up @@ -137,7 +137,7 @@ pub fn start<B>(
let instruction_sender = instruction_sender.clone();
let running = running.clone();
move || {
for evt in keyboard_events {
for evt in terminal_events {
if let BackEvent::Resize(_x, _y) = evt {
if SHOULD_HANDLE_WIN_CHANGE {
let _ = instruction_sender.send(Instruction::ResetUiMode);
Expand Down

0 comments on commit 674204f

Please sign in to comment.