From 4a176669fa93f6ea37530acb667acfaf151fb7f1 Mon Sep 17 00:00:00 2001 From: Brooks J Rady Date: Wed, 6 Jan 2021 17:46:50 +0000 Subject: [PATCH] A module rename to please clippy --- src/layout.rs | 2 +- src/main.rs | 4 ++-- src/os_input_output.rs | 2 +- src/{terminal_pane => panes}/mod.rs | 0 src/{terminal_pane => panes}/plugin_pane.rs | 2 +- src/{terminal_pane => panes}/scroll.rs | 2 +- src/{terminal_pane => panes}/terminal_character.rs | 0 src/{terminal_pane => panes}/terminal_pane.rs | 4 ++-- src/pty_bus.rs | 2 +- src/screen.rs | 4 ++-- src/tab.rs | 6 +++--- src/tests/fakes.rs | 2 +- src/tests/integration/basic.rs | 2 +- src/tests/integration/close_pane.rs | 2 +- src/tests/integration/compatibility.rs | 2 +- src/tests/integration/layouts.rs | 2 +- src/tests/integration/move_focus_down.rs | 2 +- src/tests/integration/move_focus_left.rs | 2 +- src/tests/integration/move_focus_right.rs | 2 +- src/tests/integration/move_focus_up.rs | 2 +- src/tests/integration/resize_down.rs | 2 +- src/tests/integration/resize_left.rs | 2 +- src/tests/integration/resize_right.rs | 2 +- src/tests/integration/resize_up.rs | 2 +- src/tests/integration/tabs.rs | 2 +- src/tests/integration/toggle_fullscreen.rs | 2 +- src/tests/utils.rs | 4 ++-- 27 files changed, 31 insertions(+), 31 deletions(-) rename src/{terminal_pane => panes}/mod.rs (100%) rename src/{terminal_pane => panes}/plugin_pane.rs (99%) rename src/{terminal_pane => panes}/scroll.rs (99%) rename src/{terminal_pane => panes}/terminal_character.rs (100%) rename src/{terminal_pane => panes}/terminal_pane.rs (99%) diff --git a/src/layout.rs b/src/layout.rs index 63f9c9626..c82fc404d 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use std::{fs::File, io::prelude::*, path::PathBuf}; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; fn split_space_to_parts_vertically( space_to_split: &PositionAndSize, diff --git a/src/main.rs b/src/main.rs index bad0a7712..395859df1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,10 +7,10 @@ mod errors; mod input; mod layout; mod os_input_output; +mod panes; mod pty_bus; mod screen; mod tab; -mod terminal_pane; mod utils; mod wasm_vm; @@ -21,9 +21,9 @@ use std::path::PathBuf; use std::sync::mpsc::{channel, sync_channel, Receiver, SendError, Sender, SyncSender}; use std::thread; +use panes::PaneId; use serde::{Deserialize, Serialize}; use structopt::StructOpt; -use terminal_pane::PaneId; use crate::command_is_executing::CommandIsExecuting; use crate::errors::{AppContext, ContextType, ErrorContext, PtyContext, ScreenContext}; diff --git a/src/os_input_output.rs b/src/os_input_output.rs index 94b7b98da..89ba6c720 100644 --- a/src/os_input_output.rs +++ b/src/os_input_output.rs @@ -1,4 +1,4 @@ -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use nix::fcntl::{fcntl, FcntlArg, OFlag}; use nix::pty::{forkpty, Winsize}; use nix::sys::signal::{kill, Signal}; diff --git a/src/terminal_pane/mod.rs b/src/panes/mod.rs similarity index 100% rename from src/terminal_pane/mod.rs rename to src/panes/mod.rs diff --git a/src/terminal_pane/plugin_pane.rs b/src/panes/plugin_pane.rs similarity index 99% rename from src/terminal_pane/plugin_pane.rs rename to src/panes/plugin_pane.rs index 620f67c4a..1573d5774 100644 --- a/src/terminal_pane/plugin_pane.rs +++ b/src/panes/plugin_pane.rs @@ -4,7 +4,7 @@ use crate::{pty_bus::VteEvent, tab::Pane, wasm_vm::PluginInstruction, SenderWith use std::{sync::mpsc::channel, unimplemented}; -use crate::terminal_pane::{PaneId, PositionAndSize}; +use crate::panes::{PaneId, PositionAndSize}; pub struct PluginPane { pub pid: u32, diff --git a/src/terminal_pane/scroll.rs b/src/panes/scroll.rs similarity index 99% rename from src/terminal_pane/scroll.rs rename to src/panes/scroll.rs index 6301c7c18..05252b03f 100644 --- a/src/terminal_pane/scroll.rs +++ b/src/panes/scroll.rs @@ -1,7 +1,7 @@ use std::collections::VecDeque; use std::fmt::{self, Debug, Formatter}; -use crate::terminal_pane::terminal_character::{ +use crate::panes::terminal_character::{ CharacterStyles, TerminalCharacter, EMPTY_TERMINAL_CHARACTER, }; diff --git a/src/terminal_pane/terminal_character.rs b/src/panes/terminal_character.rs similarity index 100% rename from src/terminal_pane/terminal_character.rs rename to src/panes/terminal_character.rs diff --git a/src/terminal_pane/terminal_pane.rs b/src/panes/terminal_pane.rs similarity index 99% rename from src/terminal_pane/terminal_pane.rs rename to src/panes/terminal_pane.rs index 2039b8d49..70eb216a5 100644 --- a/src/terminal_pane/terminal_pane.rs +++ b/src/panes/terminal_pane.rs @@ -5,8 +5,8 @@ use ::nix::pty::Winsize; use ::std::os::unix::io::RawFd; use ::vte::Perform; -use crate::terminal_pane::terminal_character::{CharacterStyles, TerminalCharacter}; -use crate::terminal_pane::Scroll; +use crate::panes::terminal_character::{CharacterStyles, TerminalCharacter}; +use crate::panes::Scroll; use crate::utils::logging::debug_log_to_file; use crate::VteEvent; diff --git a/src/pty_bus.rs b/src/pty_bus.rs index 0ce261c61..092998a21 100644 --- a/src/pty_bus.rs +++ b/src/pty_bus.rs @@ -14,7 +14,7 @@ use crate::os_input_output::OsApi; use crate::utils::logging::debug_to_file; use crate::{ errors::{ContextType, ErrorContext}, - terminal_pane::PaneId, + panes::PaneId, }; use crate::{ScreenInstruction, SenderWithContext, OPENCALLS}; diff --git a/src/screen.rs b/src/screen.rs index 886078143..4a9bc00cd 100644 --- a/src/screen.rs +++ b/src/screen.rs @@ -3,11 +3,11 @@ use std::os::unix::io::RawFd; use std::sync::mpsc::Receiver; use crate::os_input_output::OsApi; +use crate::panes::PositionAndSize; use crate::pty_bus::{PtyInstruction, VteEvent}; use crate::tab::Tab; -use crate::terminal_pane::PositionAndSize; use crate::{errors::ErrorContext, wasm_vm::PluginInstruction}; -use crate::{layout::Layout, terminal_pane::PaneId}; +use crate::{layout::Layout, panes::PaneId}; use crate::{AppInstruction, SenderWithContext}; /* diff --git a/src/tab.rs b/src/tab.rs index 16af135e3..bfb7ee49c 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -1,6 +1,6 @@ +use crate::panes::{PaneId, PositionAndSize, TerminalPane}; use crate::pty_bus::{PtyInstruction, VteEvent}; -use crate::terminal_pane::{PaneId, PositionAndSize, TerminalPane}; -use crate::{boundaries::Boundaries, terminal_pane::PluginPane}; +use crate::{boundaries::Boundaries, panes::PluginPane}; use crate::{layout::Layout, wasm_vm::PluginInstruction}; use crate::{os_input_output::OsApi, utils::shared::pad_to_size}; use crate::{AppInstruction, SenderWithContext}; @@ -161,7 +161,7 @@ impl Tab { BTreeMap::new() }; Tab { - index: index, + index, panes, max_panes, panes_to_hide: HashSet::new(), diff --git a/src/tests/fakes.rs b/src/tests/fakes.rs index 8ae1a972d..d15b8a88a 100644 --- a/src/tests/fakes.rs +++ b/src/tests/fakes.rs @@ -1,4 +1,4 @@ -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use std::collections::{HashMap, VecDeque}; use std::io::Write; use std::os::unix::io::RawFd; diff --git a/src/tests/integration/basic.rs b/src/tests/integration/basic.rs index adbe40825..51c7801ea 100644 --- a/src/tests/integration/basic.rs +++ b/src/tests/integration/basic.rs @@ -1,4 +1,4 @@ -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use ::insta::assert_snapshot; use crate::tests::fakes::FakeInputOutput; diff --git a/src/tests/integration/close_pane.rs b/src/tests/integration/close_pane.rs index b0c027511..3c9ac19ba 100644 --- a/src/tests/integration/close_pane.rs +++ b/src/tests/integration/close_pane.rs @@ -1,4 +1,4 @@ -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use ::insta::assert_snapshot; use crate::tests::fakes::FakeInputOutput; diff --git a/src/tests/integration/compatibility.rs b/src/tests/integration/compatibility.rs index e42a26fb8..75c7f80fa 100644 --- a/src/tests/integration/compatibility.rs +++ b/src/tests/integration/compatibility.rs @@ -1,7 +1,7 @@ use ::insta::assert_snapshot; use ::std::collections::HashMap; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::possible_tty_inputs::Bytes; use crate::tests::utils::get_output_frame_snapshots; diff --git a/src/tests/integration/layouts.rs b/src/tests/integration/layouts.rs index e65cf01e0..eff9d7830 100644 --- a/src/tests/integration/layouts.rs +++ b/src/tests/integration/layouts.rs @@ -1,7 +1,7 @@ use insta::assert_snapshot; use std::path::PathBuf; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::commands::{COMMAND_TOGGLE, QUIT}; use crate::tests::utils::get_output_frame_snapshots; diff --git a/src/tests/integration/move_focus_down.rs b/src/tests/integration/move_focus_down.rs index db6836b5b..3fb53f877 100644 --- a/src/tests/integration/move_focus_down.rs +++ b/src/tests/integration/move_focus_down.rs @@ -1,6 +1,6 @@ use ::insta::assert_snapshot; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; diff --git a/src/tests/integration/move_focus_left.rs b/src/tests/integration/move_focus_left.rs index c7ba28223..9e8cac679 100644 --- a/src/tests/integration/move_focus_left.rs +++ b/src/tests/integration/move_focus_left.rs @@ -1,6 +1,6 @@ use ::insta::assert_snapshot; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; diff --git a/src/tests/integration/move_focus_right.rs b/src/tests/integration/move_focus_right.rs index 6d674333e..c11b2caae 100644 --- a/src/tests/integration/move_focus_right.rs +++ b/src/tests/integration/move_focus_right.rs @@ -1,6 +1,6 @@ use ::insta::assert_snapshot; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; diff --git a/src/tests/integration/move_focus_up.rs b/src/tests/integration/move_focus_up.rs index 9cc4a500c..d862e1051 100644 --- a/src/tests/integration/move_focus_up.rs +++ b/src/tests/integration/move_focus_up.rs @@ -1,6 +1,6 @@ use ::insta::assert_snapshot; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; diff --git a/src/tests/integration/resize_down.rs b/src/tests/integration/resize_down.rs index a09663835..0e7ba2dbb 100644 --- a/src/tests/integration/resize_down.rs +++ b/src/tests/integration/resize_down.rs @@ -1,6 +1,6 @@ use insta::assert_snapshot; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; diff --git a/src/tests/integration/resize_left.rs b/src/tests/integration/resize_left.rs index 705c018e3..9510ad27e 100644 --- a/src/tests/integration/resize_left.rs +++ b/src/tests/integration/resize_left.rs @@ -1,6 +1,6 @@ use ::insta::assert_snapshot; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; diff --git a/src/tests/integration/resize_right.rs b/src/tests/integration/resize_right.rs index 93eefc917..b5c6d09a6 100644 --- a/src/tests/integration/resize_right.rs +++ b/src/tests/integration/resize_right.rs @@ -1,6 +1,6 @@ use ::insta::assert_snapshot; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; diff --git a/src/tests/integration/resize_up.rs b/src/tests/integration/resize_up.rs index 26962c462..a57b4ea9a 100644 --- a/src/tests/integration/resize_up.rs +++ b/src/tests/integration/resize_up.rs @@ -1,6 +1,6 @@ use ::insta::assert_snapshot; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; diff --git a/src/tests/integration/tabs.rs b/src/tests/integration/tabs.rs index 2b35017de..378cc4b8b 100644 --- a/src/tests/integration/tabs.rs +++ b/src/tests/integration/tabs.rs @@ -2,8 +2,8 @@ use ::insta::assert_snapshot; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; +use crate::{panes::PositionAndSize, tests::utils::commands::CLOSE_FOCUSED_PANE}; use crate::{start, Opt}; -use crate::{terminal_pane::PositionAndSize, tests::utils::commands::CLOSE_FOCUSED_PANE}; use crate::tests::utils::commands::{ CLOSE_TAB, COMMAND_TOGGLE, NEW_TAB, QUIT, SPLIT_HORIZONTALLY, SWITCH_NEXT_TAB, SWITCH_PREV_TAB, diff --git a/src/tests/integration/toggle_fullscreen.rs b/src/tests/integration/toggle_fullscreen.rs index 561e63e62..26060d593 100644 --- a/src/tests/integration/toggle_fullscreen.rs +++ b/src/tests/integration/toggle_fullscreen.rs @@ -1,6 +1,6 @@ use ::insta::assert_snapshot; -use crate::terminal_pane::PositionAndSize; +use crate::panes::PositionAndSize; use crate::tests::fakes::FakeInputOutput; use crate::tests::utils::get_output_frame_snapshots; use crate::{start, Opt}; diff --git a/src/tests/utils.rs b/src/tests/utils.rs index a58f800b1..63c953f66 100644 --- a/src/tests/utils.rs +++ b/src/tests/utils.rs @@ -1,5 +1,5 @@ -use crate::terminal_pane::PositionAndSize; -use crate::terminal_pane::TerminalPane; +use crate::panes::PositionAndSize; +use crate::panes::TerminalPane; pub fn get_output_frame_snapshots( output_frames: &[Vec],