From d139e19bd287ba340b923136c266a77367b83990 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 18 May 2024 16:57:03 +0200 Subject: refactor(engine): fix clippy lints --- engine/src/camera/fly.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'engine/src/camera') diff --git a/engine/src/camera/fly.rs b/engine/src/camera/fly.rs index 7fa435b..3f5a0c2 100644 --- a/engine/src/camera/fly.rs +++ b/engine/src/camera/fly.rs @@ -73,11 +73,7 @@ fn update( cursor_state.current_yaw += x_offset; cursor_state.current_pitch += y_offset; - if cursor_state.current_pitch > 89.0 { - cursor_state.current_pitch = 89.0; - } else if cursor_state.current_pitch < -89.0 { - cursor_state.current_pitch = -89.0; - } + cursor_state.current_pitch = cursor_state.current_pitch.clamp(-89.0, 89.0); // TODO: This casting to a f32 from a f64 is horrible. fix it #[allow(clippy::cast_possible_truncation)] -- cgit v1.2.3-18-g5258