Skip to content

Commit

Permalink
fix: remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
metiftikci committed Sep 21, 2023
1 parent c1eb102 commit 3d73725
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ fn main() -> Result<()> {
let palette = Palette::new(&window);
terminal.redraw(&palette)?;

terminal.read()?;

while let Ok(event) = terminal.read() {
match event {
TerminalEvent::Resize(size) => window.set_size(size.width, size.height),
Expand Down
6 changes: 4 additions & 2 deletions src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ impl Terminal {

impl Terminal {
pub fn initialize(&mut self) -> Result<()> {
crossterm::execute!(&self.stdout, terminal::EnterAlternateScreen)?;
crossterm::queue!(&self.stdout, terminal::EnterAlternateScreen)?;
terminal::enable_raw_mode()?;
self.flush()?;
Ok(())
}

pub fn terminate(&mut self) -> Result<()> {
crossterm::execute!(&self.stdout, terminal::LeaveAlternateScreen)?;
crossterm::queue!(&self.stdout, terminal::LeaveAlternateScreen)?;
terminal::disable_raw_mode()?;
self.flush()?;
Ok(())
}

Expand Down

0 comments on commit 3d73725

Please sign in to comment.