From ba6d1bce605a3cd85bc0f8c53f3687f6227c1087 Mon Sep 17 00:00:00 2001 From: Hugo Peixoto Date: Sat, 14 May 2022 14:47:43 +0100 Subject: [PATCH] Remove unnecessary code We had an unnecessary unwrap_or_else() preceded by a question mark operator, which means that the or_else clause could never be called. --- common/src/path.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/common/src/path.rs b/common/src/path.rs index 5198624a77..9f5fee663f 100644 --- a/common/src/path.rs +++ b/common/src/path.rs @@ -121,11 +121,7 @@ impl Route { { let (next0, next1, next_tgt, be_precise) = loop { // If we've reached the end of the path, stop - self.next(0)?; - - let next0 = self - .next(0) - .unwrap_or_else(|| pos.map(|e| e.floor() as i32)); + let next0 = self.next(0)?; let next1 = self.next(1).unwrap_or(next0); // Stop using obstructed paths