Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tuzz committed Aug 27, 2023
1 parent 90a3339 commit 9ca7ea5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,39 +43,34 @@ impl<G, T: TimeTrait, W> GameLoop<G, T, W> {
where U: FnMut(&mut GameLoop<G, T, W>),
R: FnMut(&mut GameLoop<G, T, W>),
{
let mut g = self;
let g = self;

if g.exit_next_iteration {
return false;
}
if g.exit_next_iteration { return false; }

g.current_instant = T::now();

let mut elapsed = g.current_instant.sub(&g.previous_instant);

if elapsed > g.max_frame_time {
elapsed = g.max_frame_time;
}
if elapsed > g.max_frame_time { elapsed = g.max_frame_time; }

g.last_frame_time = elapsed;
g.running_time += elapsed;
g.accumulated_time += elapsed;

while g.accumulated_time >= g.fixed_time_step {
update(&mut g);
update(g);

g.accumulated_time -= g.fixed_time_step;
g.number_of_updates += 1;
}

g.blending_factor = g.accumulated_time / g.fixed_time_step;

render(&mut g);
render(g);

g.number_of_renders += 1;
g.previous_instant = g.current_instant;

return true;
true
}

pub fn re_accumulate(&mut self) {
Expand Down
2 changes: 1 addition & 1 deletion src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod helper {
}
}

#[cfg(all(feature = "tao"))]
#[cfg(feature = "tao")]
mod helper {
use super::*;
use tao::event::Event;
Expand Down

0 comments on commit 9ca7ea5

Please sign in to comment.