Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKnauth committed Jan 24, 2024
1 parent 2d00f38 commit a73d1f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/livesplit-auto-splitting/src/runtime/api/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ pub fn bind<T: Timer>(linker: &mut Linker<Context<T>>) -> Result<(), CreationErr
name: "timer_reset",
})?
.func_wrap("env", "timer_current_split_index", {
|caller: Caller<'_, Context<T>>| caller.data().timer.current_split_index().map_or(-1, |i| i as i32)
|caller: Caller<'_, Context<T>>| {
caller
.data()
.timer
.current_split_index()
.map_or(-1, |i| i as i32)
}
})
.map_err(|source| CreationError::LinkFunction {
source,
Expand Down

0 comments on commit a73d1f5

Please sign in to comment.