Skip to content

Commit

Permalink
refactor(app): rename quit method to request_exit
Browse files Browse the repository at this point in the history
- Rename `quit` method to `request_exit` in App struct
- Update method calls from `quit()` to `request_exit()`
- This change improves clarity and consistency in the API
  • Loading branch information
ShenMian committed Dec 30, 2024
1 parent 7d4155d commit 5ea8a4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ impl App {
match event.code {
// Exit application on `ESC`
KeyCode::Esc => {
self.quit();
self.request_exit();
}
// Exit application on `Ctrl-C`
KeyCode::Char('c') => {
if event.modifiers == KeyModifiers::CONTROL {
self.quit();
self.request_exit();
}
}
_ => {}
Expand All @@ -128,7 +128,7 @@ impl App {
}

/// Set running to false to quit the application.
pub fn quit(&mut self) {
pub fn request_exit(&mut self) {
self.running = false;
}
}

0 comments on commit 5ea8a4b

Please sign in to comment.