mirror of
https://github.com/eliasstepanik/big_space_with_trim.git
synced 2026-01-26 13:58:30 +00:00
Fix fun and exciting new clippy lints
This commit is contained in:
parent
750a9a7398
commit
d9f531e98c
@ -47,7 +47,7 @@ pub struct ReferenceFrameCommands<'a, P: GridPrecision> {
|
|||||||
reference_frame: ReferenceFrame<P>,
|
reference_frame: ReferenceFrame<P>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, P: GridPrecision> ReferenceFrameCommands<'a, P> {
|
impl<P: GridPrecision> ReferenceFrameCommands<'_, P> {
|
||||||
/// Get a reference to the current reference frame.
|
/// Get a reference to the current reference frame.
|
||||||
pub fn frame(&mut self) -> &ReferenceFrame<P> {
|
pub fn frame(&mut self) -> &ReferenceFrame<P> {
|
||||||
&self.reference_frame
|
&self.reference_frame
|
||||||
@ -173,7 +173,7 @@ impl<'a, P: GridPrecision> ReferenceFrameCommands<'a, P> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Insert the reference frame on drop.
|
/// Insert the reference frame on drop.
|
||||||
impl<'a, P: GridPrecision> Drop for ReferenceFrameCommands<'a, P> {
|
impl<P: GridPrecision> Drop for ReferenceFrameCommands<'_, P> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
self.commands
|
self.commands
|
||||||
.entity(self.entity)
|
.entity(self.entity)
|
||||||
@ -188,7 +188,7 @@ pub struct SpatialEntityCommands<'a, P: GridPrecision> {
|
|||||||
phantom: PhantomData<P>,
|
phantom: PhantomData<P>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, P: GridPrecision> SpatialEntityCommands<'a, P> {
|
impl<P: GridPrecision> SpatialEntityCommands<'_, P> {
|
||||||
/// Insert a component on this reference frame
|
/// Insert a component on this reference frame
|
||||||
pub fn insert(&mut self, bundle: impl Bundle) -> &mut Self {
|
pub fn insert(&mut self, bundle: impl Bundle) -> &mut Self {
|
||||||
self.commands.entity(self.entity).insert(bundle);
|
self.commands.entity(self.entity).insert(bundle);
|
||||||
|
|||||||
@ -230,7 +230,7 @@ pub struct ReferenceFrames<'w, 's, P: GridPrecision> {
|
|||||||
frame_query: Query<'w, 's, (Entity, Read<ReferenceFrame<P>>, Option<Read<Parent>>)>,
|
frame_query: Query<'w, 's, (Entity, Read<ReferenceFrame<P>>, Option<Read<Parent>>)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'w, 's, P: GridPrecision> ReferenceFrames<'w, 's, P> {
|
impl<P: GridPrecision> ReferenceFrames<'_, '_, P> {
|
||||||
/// Get a [`ReferenceFrame`] from its `Entity`.
|
/// Get a [`ReferenceFrame`] from its `Entity`.
|
||||||
pub fn get(&self, frame_entity: Entity) -> &ReferenceFrame<P> {
|
pub fn get(&self, frame_entity: Entity) -> &ReferenceFrame<P> {
|
||||||
self.frame_query
|
self.frame_query
|
||||||
@ -301,7 +301,7 @@ pub struct ReferenceFramesMut<'w, 's, P: GridPrecision> {
|
|||||||
frame_query: Query<'w, 's, (Entity, Write<ReferenceFrame<P>>, Option<Read<Parent>>)>,
|
frame_query: Query<'w, 's, (Entity, Write<ReferenceFrame<P>>, Option<Read<Parent>>)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'w, 's, P: GridPrecision> ReferenceFramesMut<'w, 's, P> {
|
impl<P: GridPrecision> ReferenceFramesMut<'_, '_, P> {
|
||||||
/// Get mutable access to the [`ReferenceFrame`], and run the provided function or closure,
|
/// Get mutable access to the [`ReferenceFrame`], and run the provided function or closure,
|
||||||
/// optionally returning data.
|
/// optionally returning data.
|
||||||
///
|
///
|
||||||
|
|||||||
@ -21,7 +21,7 @@ pub struct GridTransform<P: GridPrecision> {
|
|||||||
pub cell: &'static mut GridCell<P>,
|
pub cell: &'static mut GridCell<P>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'w, P: GridPrecision> GridTransformItem<'w, P> {
|
impl<P: GridPrecision> GridTransformItem<'_, P> {
|
||||||
/// Compute the global position with double precision.
|
/// Compute the global position with double precision.
|
||||||
pub fn position_double(&self, reference_frame: &ReferenceFrame<P>) -> DVec3 {
|
pub fn position_double(&self, reference_frame: &ReferenceFrame<P>) -> DVec3 {
|
||||||
reference_frame.grid_position_double(&self.cell, &self.transform)
|
reference_frame.grid_position_double(&self.cell, &self.transform)
|
||||||
@ -41,7 +41,7 @@ impl<'w, P: GridPrecision> GridTransformItem<'w, P> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'w, P: GridPrecision> GridTransformReadOnlyItem<'w, P> {
|
impl<P: GridPrecision> GridTransformReadOnlyItem<'_, P> {
|
||||||
/// Compute the global position with double precision.
|
/// Compute the global position with double precision.
|
||||||
pub fn position_double(&self, reference_frame: &ReferenceFrame<P>) -> DVec3 {
|
pub fn position_double(&self, reference_frame: &ReferenceFrame<P>) -> DVec3 {
|
||||||
reference_frame.grid_position_double(self.cell, self.transform)
|
reference_frame.grid_position_double(self.cell, self.transform)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user