Skip to content

Commit

Permalink
refactor(example): remove pointless new method (#1038)
Browse files Browse the repository at this point in the history
Use `App::default()` directly.
  • Loading branch information
EdJoPaTo authored Apr 16, 2024
1 parent 1126478 commit bef5bcf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions examples/demo2/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,10 @@ enum Tab {
}

pub fn run(terminal: &mut Terminal<impl Backend>) -> Result<()> {
App::new().run(terminal)
App::default().run(terminal)
}

impl App {
pub fn new() -> Self {
Self::default()
}

/// Run the app until the user quits.
pub fn run(&mut self, terminal: &mut Terminal<impl Backend>) -> Result<()> {
while self.is_running() {
Expand Down
2 changes: 1 addition & 1 deletion examples/demo2/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub use theme::*;
fn main() -> Result<()> {
errors::init_hooks()?;
let terminal = &mut term::init()?;
App::new().run(terminal)?;
App::default().run(terminal)?;
term::restore()?;
Ok(())
}

0 comments on commit bef5bcf

Please sign in to comment.