aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-02-22 23:01:54 +0000
committermat <git@matdoes.dev>2025-02-22 23:01:54 +0000
commit34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (patch)
tree7920fec1203e8e96463a142f5f6da6164e76e684 /azalea-core/src
parentbdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff)
downloadazalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz
update to rust edition 2024
Diffstat (limited to 'azalea-core/src')
-rw-r--r--azalea-core/src/math.rs12
-rw-r--r--azalea-core/src/registry_holder.rs2
-rwxr-xr-xazalea-core/src/resource_location.rs4
3 files changed, 5 insertions, 13 deletions
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 {