Browse Source

Fix ``Try`` logic

pull/74/head
TechiePi 2 years ago
parent
commit
28cb72addd
  1. 7
      ctru-rs/src/error.rs

7
ctru-rs/src/error.rs

@ -20,9 +20,10 @@ impl Try for LibCtruError { @@ -20,9 +20,10 @@ impl Try for LibCtruError {
}
fn branch(self) -> ControlFlow<Self::Residual, Self::Output> {
match self.0 {
0 => ControlFlow::Continue(()),
_ => ControlFlow::Break(Err(self.into())),
if self.0 < 0 {
ControlFlow::Break(Err(self.into()))
} else {
ControlFlow::Continue(())
}
}
}

Loading…
Cancel
Save