summaryrefslogtreecommitdiff
path: root/src/hook.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/hook.rs')
-rw-r--r--src/hook.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hook.rs b/src/hook.rs
index 443facd..950bc79 100644
--- a/src/hook.rs
+++ b/src/hook.rs
@@ -353,8 +353,10 @@ impl HookTriggers {
// Returns the `count` parameter to pass to `lua_sethook`, if applicable. Otherwise, zero is
// returned.
pub(crate) const fn count(&self) -> c_int {
- let Some(n) = self.every_nth_instruction else { return 0 };
- n as c_int
+ match self.every_nth_instruction {
+ Some(n) => n as c_int,
+ None => 0,
+ }
}
}