From 267c91d005d0bfaf17f12a606fe97a0368d5b4b4 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 21 Jan 2025 12:59:34 -0800 Subject: [PATCH] replace `.map_or(None,` with `.and_then(` --- strafe-client/src/model_physics.rs | 6 +++--- strafe-client/src/physics.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/strafe-client/src/model_physics.rs b/strafe-client/src/model_physics.rs index 9aa0d716..7601058c 100644 --- a/strafe-client/src/model_physics.rs +++ b/strafe-client/src/model_physics.rs @@ -720,7 +720,7 @@ impl MinkowskiMesh<'_>{ // Most of the calculation time is just calculating the starting point // for the "actual" crawling algorithm below (predict_collision_{in|out}). fn closest_fev_not_inside(&self,mut infinity_body:Body,start_time:Time)->Option>{ - infinity_body.infinity_dir().map_or(None,|dir|{ + infinity_body.infinity_dir().and_then(|dir|{ let infinity_fev=self.infinity_fev(-dir,infinity_body.position); //a line is simpler to solve than a parabola infinity_body.velocity=dir; @@ -731,7 +731,7 @@ impl MinkowskiMesh<'_>{ }) } pub fn predict_collision_in(&self,relative_body:&Body,Range{start:start_time,end:time_limit}:Range