From 28cb72addd2b9836df4e56ceeae416f734d83703 Mon Sep 17 00:00:00 2001 From: TechiePi Date: Sun, 9 Oct 2022 02:13:33 +0200 Subject: [PATCH] Fix ``Try`` logic --- ctru-rs/src/error.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index 73b78b5..38841da 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -20,9 +20,10 @@ impl Try for LibCtruError { } fn branch(self) -> ControlFlow { - match self.0 { - 0 => ControlFlow::Continue(()), - _ => ControlFlow::Break(Err(self.into())), + if self.0 < 0 { + ControlFlow::Break(Err(self.into())) + } else { + ControlFlow::Continue(()) } } }