From e39645bbec1728cf27c45d994d596c0be9d096fb Mon Sep 17 00:00:00 2001 From: Erik Kundt Date: Mon, 5 Feb 2024 14:40:06 +0100 Subject: [PATCH] patch/issue-select: Improve app exit --- bin/commands/issue/select/event.rs | 8 ++++---- bin/commands/patch/select/event.rs | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/commands/issue/select/event.rs b/bin/commands/issue/select/event.rs index 4ea5b124..55936af0 100644 --- a/bin/commands/issue/select/event.rs +++ b/bin/commands/issue/select/event.rs @@ -111,7 +111,7 @@ impl tuirealm::Component for Widget { code: Key::Enter, .. }) => submit().map(|id| { let exit = SelectionExit::default() - .with_operation(format!("{}", IssueOperation::Show)) + .with_operation(IssueOperation::Show.to_string()) .with_id(IssueId::from(id)); Message::Quit(Some(exit)) }), @@ -120,7 +120,7 @@ impl tuirealm::Component for Widget { .. }) => submit().map(|id| { let exit = SelectionExit::default() - .with_operation(format!("{}", IssueOperation::Delete)) + .with_operation(IssueOperation::Delete.to_string()) .with_id(IssueId::from(id)); Message::Quit(Some(exit)) }), @@ -129,7 +129,7 @@ impl tuirealm::Component for Widget { .. }) => submit().map(|id| { let exit = SelectionExit::default() - .with_operation(format!("{}", IssueOperation::Edit)) + .with_operation(IssueOperation::Edit.to_string()) .with_id(IssueId::from(id)); Message::Quit(Some(exit)) }), @@ -138,7 +138,7 @@ impl tuirealm::Component for Widget { .. }) => submit().map(|id| { let exit = SelectionExit::default() - .with_operation(format!("{}", IssueOperation::Comment)) + .with_operation(IssueOperation::Comment.to_string()) .with_id(IssueId::from(id)); Message::Quit(Some(exit)) }), diff --git a/bin/commands/patch/select/event.rs b/bin/commands/patch/select/event.rs index facc8c33..f050127f 100644 --- a/bin/commands/patch/select/event.rs +++ b/bin/commands/patch/select/event.rs @@ -111,7 +111,7 @@ impl tuirealm::Component for Widget { code: Key::Enter, .. }) => submit().map(|id| { let exit = SelectionExit::default() - .with_operation(format!("{}", PatchOperation::Show)) + .with_operation(PatchOperation::Show.to_string()) .with_id(PatchId::from(id)); Message::Quit(Some(exit)) }), @@ -120,7 +120,7 @@ impl tuirealm::Component for Widget { .. }) => submit().map(|id| { let exit = SelectionExit::default() - .with_operation(format!("{}", PatchOperation::Checkout)) + .with_operation(PatchOperation::Checkout.to_string()) .with_id(PatchId::from(id)); Message::Quit(Some(exit)) }), @@ -129,7 +129,7 @@ impl tuirealm::Component for Widget { .. }) => submit().map(|id| { let exit = SelectionExit::default() - .with_operation(format!("{}", PatchOperation::Delete)) + .with_operation(PatchOperation::Delete.to_string()) .with_id(PatchId::from(id)); Message::Quit(Some(exit)) }), @@ -138,7 +138,7 @@ impl tuirealm::Component for Widget { .. }) => submit().map(|id| { let exit = SelectionExit::default() - .with_operation(format!("{}", PatchOperation::Edit)) + .with_operation(PatchOperation::Edit.to_string()) .with_id(PatchId::from(id)); Message::Quit(Some(exit)) }), @@ -147,7 +147,7 @@ impl tuirealm::Component for Widget { .. }) => submit().map(|id| { let exit = SelectionExit::default() - .with_operation(format!("{}", PatchOperation::Comment)) + .with_operation(PatchOperation::Comment.to_string()) .with_id(PatchId::from(id)); Message::Quit(Some(exit)) }),