Skip to content

Instantly share code, notes, and snippets.

View andihaki's full-sized avatar
🇮🇩
code & pray balance

andi hakim arif andihaki

🇮🇩
code & pray balance
View GitHub Profile
fn handle_event(&mut self, event: &Event) -> bool {
if let Event::Key(key) = event {
if key.kind == KeyEventKind::Press {
match key.code {
KeyCode::Char('q') | KeyCode::Esc => return false,
KeyCode::Enter => self.calculate_tax(),
KeyCode::Backspace => {
self.input.pop();
}
KeyCode::Char(c) => {