mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-27 05:40:32 +01:00
Fix other clippy warnings.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::VecDeque;
|
||||
use std::io::Read;
|
||||
@@ -124,8 +125,8 @@ impl Day20 {
|
||||
});
|
||||
for dir in dirs {
|
||||
let new_pos = dir.walk(pos);
|
||||
if !visited.contains_key(&new_pos) {
|
||||
visited.insert(new_pos, dist + 1);
|
||||
if let Entry::Vacant(entry) = visited.entry(new_pos) {
|
||||
entry.insert(dist + 1);
|
||||
todo.push_back((dist + 1, new_pos));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user