Skip to content

Commit

Permalink
LocalizationMapML with public fields instead of getters
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmusgo committed Feb 23, 2024
1 parent b1329b1 commit 1a66164
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions openxr/src/localization_map_ml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,18 @@ use crate::*;

#[derive(Clone)]
pub struct LocalizationMapML {
inner: sys::LocalizationMapML,
pub name: String,
pub map_uuid: UuidEXT,
pub map_type: LocalizationMapTypeML,
}

impl LocalizationMapML {
#[inline]
pub fn from_raw(inner: sys::LocalizationMapML) -> Self {
Self { inner }
}
#[inline]
pub fn as_raw(&self) -> sys::LocalizationMapML {
self.inner
}
#[inline]
pub fn name(&self) -> &str {
unsafe {
std::ffi::CStr::from_ptr(self.inner.name.as_ptr())
.to_str()
.unwrap()
Self {
name: unsafe { fixed_str(&inner.name).into() },
map_uuid: inner.map_uuid,
map_type: inner.map_type,
}
}
#[inline]
pub fn map_uuid(&self) -> UuidEXT {
self.inner.map_uuid
}
#[inline]
pub fn map_type(&self) -> LocalizationMapTypeML {
self.inner.map_type
}
}

0 comments on commit 1a66164

Please sign in to comment.