diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-05-04 12:54:08 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-05-04 12:54:08 -0400 |
commit | 99d8dcfb0cb3043e43473eeb8619968cd0da2aaf (patch) | |
tree | 854e196852a41c26bda07d65a75f8be3edd31fd2 /src/context | |
parent | d95ded0d6337f86f9aeecb9533ae2c3040abc326 (diff) |
move input.rs to process_event.rs
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/app_context.rs | 1 | ||||
-rw-r--r-- | src/context/commandline_context.rs | 1 | ||||
-rw-r--r-- | src/context/message_queue.rs | 19 | ||||
-rw-r--r-- | src/context/preview_context.rs | 1 |
4 files changed, 8 insertions, 14 deletions
diff --git a/src/context/app_context.rs b/src/context/app_context.rs index b2b70e1..364b5b1 100644 --- a/src/context/app_context.rs +++ b/src/context/app_context.rs @@ -282,7 +282,6 @@ impl AppContext { pub fn commandline_context_ref(&self) -> &CommandLineContext { &self.commandline_context } - pub fn commandline_context_mut(&mut self) -> &mut CommandLineContext { &mut self.commandline_context } diff --git a/src/context/commandline_context.rs b/src/context/commandline_context.rs index 6a6142b..5169029 100644 --- a/src/context/commandline_context.rs +++ b/src/context/commandline_context.rs @@ -20,7 +20,6 @@ impl CommandLineContext { pub fn history_ref(&self) -> &history::History { &self.history } - pub fn history_mut(&mut self) -> &mut history::History { &mut self.history } diff --git a/src/context/message_queue.rs b/src/context/message_queue.rs index f90ad53..0208b96 100644 --- a/src/context/message_queue.rs +++ b/src/context/message_queue.rs @@ -23,30 +23,27 @@ impl MessageQueue { Self::default() } - pub fn push_success(&mut self, msg: String) { - let message = Message::new(msg, Style::default().fg(Color::Green)); - self.push_msg(message); - } - pub fn push_info(&mut self, msg: String) { let message = Message::new(msg, Style::default().fg(Color::Yellow)); self.push_msg(message); } - + pub fn push_success(&mut self, msg: String) { + let message = Message::new(msg, Style::default().fg(Color::Green)); + self.push_msg(message); + } pub fn push_error(&mut self, msg: String) { let message = Message::new(msg, Style::default().fg(Color::Red)); self.push_msg(message); } - fn push_msg(&mut self, msg: Message) { - self.contents.push_back(msg); - } - pub fn pop_front(&mut self) -> Option<Message> { self.contents.pop_front() } - pub fn current_message(&self) -> Option<&Message> { self.contents.front() } + + fn push_msg(&mut self, msg: Message) { + self.contents.push_back(msg); + } } diff --git a/src/context/preview_context.rs b/src/context/preview_context.rs index f952629..05adc5e 100644 --- a/src/context/preview_context.rs +++ b/src/context/preview_context.rs @@ -17,7 +17,6 @@ impl PreviewContext { pub fn get_preview_ref(&self, p: &path::Path) -> Option<&Option<FilePreview>> { self.previews.get(p) } - pub fn get_preview_mut(&mut self, p: &path::Path) -> Option<&mut Option<FilePreview>> { self.previews.get_mut(p) } |