Skip to content

Commit

Permalink
🚨 make clippy happy again
Browse files Browse the repository at this point in the history
  • Loading branch information
Roms1383 committed Nov 29, 2024
1 parent 90d67b3 commit d855aa5
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions crates/audioware/src/types/vanilla/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,10 @@ impl AsEntity for Ref<Entity> {
let cls = rtti.get_class(CName::new(Entity::NAME)).unwrap();
let method: &Method = cls.get_method(CName::new("GetWorldPosition")).ok().unwrap();
match unsafe { self.instance() } {
Some(x) if x.status == EntityStatus::Attached => {
return method
.as_function()
.execute::<_, Vector4>(Some(x.as_ref()), ())
.unwrap()
}
Some(x) if x.status == EntityStatus::Attached => method
.as_function()
.execute::<_, Vector4>(Some(x.as_ref()), ())
.unwrap(),
_ => Vec3::ZERO.into(),
}
}
Expand All @@ -102,12 +100,10 @@ impl AsEntity for Ref<Entity> {
let cls = rtti.get_class(CName::new(Entity::NAME)).unwrap();
let method: &Method = cls.get_method(CName::new("GetWorldForward")).ok().unwrap();
match unsafe { self.instance() } {
Some(x) if x.status == EntityStatus::Attached => {
return method
.as_function()
.execute::<_, Vector4>(Some(x.as_ref()), ())
.unwrap()
}
Some(x) if x.status == EntityStatus::Attached => method
.as_function()
.execute::<_, Vector4>(Some(x.as_ref()), ())
.unwrap(),
_ => Vec3::NEG_Z.into(),
}
}
Expand All @@ -120,12 +116,10 @@ impl AsEntity for Ref<Entity> {
.ok()
.unwrap();
match unsafe { self.instance() } {
Some(x) if x.status == EntityStatus::Attached => {
return method
.as_function()
.execute::<_, Quaternion>(Some(x.as_ref()), ())
.unwrap()
}
Some(x) if x.status == EntityStatus::Attached => method
.as_function()
.execute::<_, Quaternion>(Some(x.as_ref()), ())
.unwrap(),
_ => Quat::IDENTITY.into(),
}
}
Expand All @@ -138,12 +132,10 @@ impl AsEntity for Ref<Entity> {
.ok()
.unwrap();
match unsafe { self.instance() } {
Some(x) if x.status == EntityStatus::Attached => {
return method
.as_function()
.execute::<_, WorldTransform>(Some(x.as_ref()), ())
.unwrap()
}
Some(x) if x.status == EntityStatus::Attached => method
.as_function()
.execute::<_, WorldTransform>(Some(x.as_ref()), ())
.unwrap(),
_ => WorldTransform::default(),
}
}
Expand Down

0 comments on commit d855aa5

Please sign in to comment.