aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src/entity/mod.rs
diff options
context:
space:
mode:
authorUbuntu <github@matdoes.dev>2022-11-15 20:38:32 +0000
committerUbuntu <github@matdoes.dev>2022-11-15 20:38:32 +0000
commit614c0df0537567c75f781df7affc091a4a466226 (patch)
treeffd4b23e4692cbdd6c966d389901fbe24d0ad76b /azalea-world/src/entity/mod.rs
parent9f78b3f4a7229033a3f5acaad6c8fffbe24e3e75 (diff)
downloadazalea-drasl-614c0df0537567c75f781df7affc091a4a466226.tar.xz
clippy
Diffstat (limited to 'azalea-world/src/entity/mod.rs')
-rw-r--r--azalea-world/src/entity/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/azalea-world/src/entity/mod.rs b/azalea-world/src/entity/mod.rs
index 63147ced..540bfeed 100644
--- a/azalea-world/src/entity/mod.rs
+++ b/azalea-world/src/entity/mod.rs
@@ -270,10 +270,19 @@ impl EntityData {
&self.pos
}
+ /// Convert this &mut self into a (mutable) pointer.
+ ///
+ /// # Safety
+ /// The entity MUST exist while this pointer exists.
pub unsafe fn as_ptr(&mut self) -> NonNull<EntityData> {
NonNull::new_unchecked(self as *mut EntityData)
}
+ /// Convert this &self into a (mutable) pointer.
+ ///
+ /// # Safety
+ /// The entity MUST exist while this pointer exists. You also must not
+ /// modify the data inside the pointer.
pub unsafe fn as_const_ptr(&self) -> NonNull<EntityData> {
// this is cursed
NonNull::new_unchecked(self as *const EntityData as *mut EntityData)