fix: clippy warns

This commit is contained in:
Snowiiii committed 2024-08-25 00:19:16 +02:00
1 parent 024789dfbb
commit 80477f9aab
2 files changed
+2 -4

No files matched your search

+1 -3
View File
@@ -50,9 +50,7 @@ impl Player {
self.awaiting_teleport = None; self.awaiting_teleport = None;
} else { } else {
self.kick(TextComponent::text( self.kick(TextComponent::text("Wrong teleport id"))
"Wrong teleport id",
))
} }
} else { } else {
self.kick(TextComponent::text( self.kick(TextComponent::text(
+1 -1
View File
@@ -98,7 +98,7 @@ impl Player {
pub fn teleport(&mut self, x: f64, y: f64, z: f64, yaw: f32, pitch: f32) { pub fn teleport(&mut self, x: f64, y: f64, z: f64, yaw: f32, pitch: f32) {
// this is the ultra special magic code used to create the teleport id // this is the ultra special magic code used to create the teleport id
self.teleport_id_count += 1; self.teleport_id_count += 1;
if self.teleport_id_count == i32::max_value() { if self.teleport_id_count == i32::MAX {
self.teleport_id_count = 0; self.teleport_id_count = 0;
} }
let entity = &mut self.entity; let entity = &mut self.entity;