From 53854d93d452f734b1e2457a1399cd4b0f98395b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Sun, 22 Aug 2021 20:47:47 +1200 Subject: [PATCH] Change Outcome::OrStart to the more flexible ::IfRunning --- lib/src/action.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/src/action.rs b/lib/src/action.rs index 16e18c6..def1d63 100644 --- a/lib/src/action.rs +++ b/lib/src/action.rs @@ -55,6 +55,7 @@ pub struct Action { } #[derive(Clone, Debug, PartialEq, Eq)] +#[non_exhaustive] pub enum Outcome { /// Stop processing this action silently. DoNothing, @@ -68,9 +69,11 @@ pub enum Outcome { /// Send this signal to the command. Signal(Signal), - /// When command is running: do the inner outcome. - /// Otherwise: start the command. - OrStart(Box), + /// When command is running, do the first, otherwise the second. + IfRunning(Box, Box), + + /// Clear the screen before doing the inner outcome. + ClearAnd(Box), } impl Default for Outcome {