1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 10:44:07 +02:00
This commit is contained in:
Robin Appelman 2023-06-08 19:29:41 +02:00
commit 0850bb8dbd
13 changed files with 946 additions and 55 deletions

View file

@ -98,7 +98,7 @@ impl<'a> RawEntity<'a> {
pub fn prop(&self, key: &'static str) -> Result<&'a str, EntityParseError> {
self.properties()
.find_map(|(prop_key, value)| (key == prop_key).then(|| value))
.find_map(|(prop_key, value)| (key == prop_key).then_some(value))
.ok_or(EntityParseError::NoSuchProperty(key))
}

View file

@ -339,7 +339,7 @@ pub struct SurfaceEdge {
impl SurfaceEdge {
pub fn edge_index(&self) -> u32 {
self.edge.abs() as u32
self.edge.unsigned_abs()
}
pub fn direction(&self) -> EdgeDirection {
@ -374,7 +374,7 @@ pub struct Face {
impl Face {
pub fn displacement_index(&self) -> Option<i16> {
(self.displacement_info >= 0).then(|| self.displacement_info)
(self.displacement_info >= 0).then_some(self.displacement_info)
}
}