From 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 22 Feb 2025 23:01:54 +0000 Subject: update to rust edition 2024 --- azalea-core/src/math.rs | 12 ++---------- azalea-core/src/registry_holder.rs | 2 +- azalea-core/src/resource_location.rs | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) (limited to 'azalea-core/src') diff --git a/azalea-core/src/math.rs b/azalea-core/src/math.rs index a763fc49..c09bddda 100644 --- a/azalea-core/src/math.rs +++ b/azalea-core/src/math.rs @@ -91,18 +91,10 @@ pub fn to_degrees(radians: f64) -> f64 { /// /// This function exists because f64::signum doesn't check for 0. pub fn sign(num: f64) -> f64 { - if num == 0. { - 0. - } else { - num.signum() - } + if num == 0. { 0. } else { num.signum() } } pub fn sign_as_int(num: f64) -> i32 { - if num == 0. { - 0 - } else { - num.signum() as i32 - } + if num == 0. { 0 } else { num.signum() as i32 } } #[cfg(test)] diff --git a/azalea-core/src/registry_holder.rs b/azalea-core/src/registry_holder.rs index b2f1f5b9..f5657dc6 100644 --- a/azalea-core/src/registry_holder.rs +++ b/azalea-core/src/registry_holder.rs @@ -9,8 +9,8 @@ use std::{collections::HashMap, io::Cursor}; use indexmap::IndexMap; use simdnbt::{ - owned::{NbtCompound, NbtTag}, Deserialize, FromNbtTag, Serialize, ToNbtTag, + owned::{NbtCompound, NbtTag}, }; use tracing::error; diff --git a/azalea-core/src/resource_location.rs b/azalea-core/src/resource_location.rs index c95e3109..0b21a43b 100755 --- a/azalea-core/src/resource_location.rs +++ b/azalea-core/src/resource_location.rs @@ -8,8 +8,8 @@ use std::{ use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; #[cfg(feature = "serde")] -use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; -use simdnbt::{owned::NbtTag, FromNbtTag, ToNbtTag}; +use serde::{Deserialize, Deserializer, Serialize, Serializer, de}; +use simdnbt::{FromNbtTag, ToNbtTag, owned::NbtTag}; #[derive(Hash, Clone, PartialEq, Eq)] pub struct ResourceLocation { -- cgit v1.2.3