mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
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.
This commit is contained in:
parent
ff16fc52c9
commit
ba6d1bce60
@ -121,11 +121,7 @@ impl Route {
|
|||||||
{
|
{
|
||||||
let (next0, next1, next_tgt, be_precise) = loop {
|
let (next0, next1, next_tgt, be_precise) = loop {
|
||||||
// If we've reached the end of the path, stop
|
// If we've reached the end of the path, stop
|
||||||
self.next(0)?;
|
let next0 = self.next(0)?;
|
||||||
|
|
||||||
let next0 = self
|
|
||||||
.next(0)
|
|
||||||
.unwrap_or_else(|| pos.map(|e| e.floor() as i32));
|
|
||||||
let next1 = self.next(1).unwrap_or(next0);
|
let next1 = self.next(1).unwrap_or(next0);
|
||||||
|
|
||||||
// Stop using obstructed paths
|
// Stop using obstructed paths
|
||||||
|
Loading…
Reference in New Issue
Block a user