Skip to content

Commit b869f9a

Browse files
committed
fix(style): use Vec::if_pop() when appropriate
1 parent d05f44d commit b869f9a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/directed/astar.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,7 @@ impl<N: Clone + Eq + Hash> AstarSolution<N> {
364364
}
365365

366366
fn next_vec(&mut self) {
367-
while self.current.last().map(Vec::len) == Some(1) {
368-
self.current.pop();
369-
}
367+
while self.current.pop_if(|v| v.len() == 1).is_some() {}
370368
self.current.last_mut().map(Vec::pop);
371369
}
372370

0 commit comments

Comments
 (0)