Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo-Zhixing committed Oct 16, 2024
1 parent 0846df0 commit 12a512c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions ash/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,6 @@ impl<'a> TaggedObject<'a> {
pub unsafe fn from_raw_mut(obj: *mut vk::BaseOutStructure<'a>) -> &'a mut Self {
&mut *(obj as *mut Self)
}
pub fn base_structure(&self) -> &vk::BaseInStructure<'a> {
unsafe { &self.input }
}
pub fn base_structure_mut(&mut self) -> &mut vk::BaseOutStructure<'a> {
unsafe { &mut self.output }
}

pub fn from_ref<T: TaggedStructure<'a> + ?Sized>(obj: &T) -> &Self {
unsafe { &*(<*const T>::cast(obj)) }
Expand All @@ -326,7 +320,7 @@ impl<'a> TaggedObject<'a> {
unsafe { &mut *(<*mut T>::cast(obj)) }
}
pub fn tag(&self) -> vk::StructureType {
self.base_structure().s_type
self.as_base().s_type
}
pub fn downcast_ref<T: TaggedStructure<'a>>(&self) -> Option<&T> {
unsafe {
Expand Down

0 comments on commit 12a512c

Please sign in to comment.