aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src/entity.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-19 22:01:54 -0500
committermat <github@matdoes.dev>2022-06-19 22:01:54 -0500
commitc9a070f711a6fdaf505f522cb8809749c9190e38 (patch)
treec64f5d6aaa4f489538d2e81814b31b5abca71a9e /azalea-world/src/entity.rs
parentd674633e856f0ac1683172ad5655ff7026c6eae6 (diff)
downloadazalea-drasl-c9a070f711a6fdaf505f522cb8809749c9190e38.tar.xz
Fix some clippy warnings
Diffstat (limited to 'azalea-world/src/entity.rs')
-rw-r--r--azalea-world/src/entity.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/azalea-world/src/entity.rs b/azalea-world/src/entity.rs
index 7077d0c4..2409995c 100644
--- a/azalea-world/src/entity.rs
+++ b/azalea-world/src/entity.rs
@@ -34,7 +34,7 @@ impl EntityStorage {
pub fn remove_by_id(&mut self, id: u32) {
if let Some(entity) = self.by_id.remove(&id) {
let entity_chunk = ChunkPos::from(entity.pos());
- if let None = self.by_chunk.remove(&entity_chunk) {
+ if self.by_chunk.remove(&entity_chunk).is_none() {
warn!("Tried to remove entity with id {id} from chunk {entity_chunk:?} but it was not found.");
}
} else {
@@ -80,3 +80,9 @@ impl EntityStorage {
.insert(entity_id);
}
}
+
+impl Default for EntityStorage {
+ fn default() -> Self {
+ Self::new()
+ }
+}