fix clippy needless lifetimes (#769)
+ ignore them for bevy where we often want explicitness
This commit is contained in:
@@ -41,6 +41,9 @@ unstable-puffin-pr-235 = []
|
|||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = ["parallel", "profiling"]
|
features = ["parallel", "profiling"]
|
||||||
|
|
||||||
|
[lints.clippy]
|
||||||
|
needless_lifetimes = "allow"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nalgebra = { version = "0.33", features = ["rand", "glam027"] }
|
nalgebra = { version = "0.33", features = ["rand", "glam027"] }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ unstable-puffin-pr-235 = []
|
|||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = ["parallel", "other-backends", "profiling"]
|
features = ["parallel", "other-backends", "profiling"]
|
||||||
|
|
||||||
|
[lints.clippy]
|
||||||
|
needless_lifetimes = "allow"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nalgebra = { version = "0.33", features = ["rand", "glam027"] }
|
nalgebra = { version = "0.33", features = ["rand", "glam027"] }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ unstable-puffin-pr-235 = []
|
|||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = ["parallel", "profiling"]
|
features = ["parallel", "profiling"]
|
||||||
|
|
||||||
|
[lints.clippy]
|
||||||
|
needless_lifetimes = "allow"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nalgebra = { version = "0.33", features = ["rand", "glam027"] }
|
nalgebra = { version = "0.33", features = ["rand", "glam027"] }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ unstable-puffin-pr-235 = []
|
|||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = ["parallel", "other-backends", "profiling"]
|
features = ["parallel", "other-backends", "profiling"]
|
||||||
|
|
||||||
|
[lints.clippy]
|
||||||
|
needless_lifetimes = "allow"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nalgebra = { version = "0.33", features = ["rand", "glam027"] }
|
nalgebra = { version = "0.33", features = ["rand", "glam027"] }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ pub struct PathConvIter<'a> {
|
|||||||
deferred: Option<PathEvent>,
|
deferred: Option<PathEvent>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'l> Iterator for PathConvIter<'l> {
|
impl Iterator for PathConvIter<'_> {
|
||||||
type Item = PathEvent;
|
type Item = PathEvent;
|
||||||
fn next(&mut self) -> Option<PathEvent> {
|
fn next(&mut self) -> Option<PathEvent> {
|
||||||
if self.deferred.is_some() {
|
if self.deferred.is_some() {
|
||||||
|
|||||||
@@ -965,7 +965,7 @@ impl<'a, T> Iterator for Iter<'a, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
|
impl<T> DoubleEndedIterator for Iter<'_, T> {
|
||||||
fn next_back(&mut self) -> Option<Self::Item> {
|
fn next_back(&mut self) -> Option<Self::Item> {
|
||||||
loop {
|
loop {
|
||||||
match self.inner.next_back() {
|
match self.inner.next_back() {
|
||||||
@@ -993,13 +993,13 @@ impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> ExactSizeIterator for Iter<'a, T> {
|
impl<T> ExactSizeIterator for Iter<'_, T> {
|
||||||
fn len(&self) -> usize {
|
fn len(&self) -> usize {
|
||||||
self.len
|
self.len
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> FusedIterator for Iter<'a, T> {}
|
impl<T> FusedIterator for Iter<'_, T> {}
|
||||||
|
|
||||||
impl<'a, T> IntoIterator for &'a mut Arena<T> {
|
impl<'a, T> IntoIterator for &'a mut Arena<T> {
|
||||||
type Item = (Index, &'a mut T);
|
type Item = (Index, &'a mut T);
|
||||||
@@ -1069,7 +1069,7 @@ impl<'a, T> Iterator for IterMut<'a, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
|
impl<T> DoubleEndedIterator for IterMut<'_, T> {
|
||||||
fn next_back(&mut self) -> Option<Self::Item> {
|
fn next_back(&mut self) -> Option<Self::Item> {
|
||||||
loop {
|
loop {
|
||||||
match self.inner.next_back() {
|
match self.inner.next_back() {
|
||||||
@@ -1097,13 +1097,13 @@ impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> ExactSizeIterator for IterMut<'a, T> {
|
impl<T> ExactSizeIterator for IterMut<'_, T> {
|
||||||
fn len(&self) -> usize {
|
fn len(&self) -> usize {
|
||||||
self.len
|
self.len
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> FusedIterator for IterMut<'a, T> {}
|
impl<T> FusedIterator for IterMut<'_, T> {}
|
||||||
|
|
||||||
/// An iterator that removes elements from the arena.
|
/// An iterator that removes elements from the arena.
|
||||||
///
|
///
|
||||||
@@ -1135,7 +1135,7 @@ pub struct Drain<'a, T: 'a> {
|
|||||||
inner: iter::Enumerate<vec::Drain<'a, Entry<T>>>,
|
inner: iter::Enumerate<vec::Drain<'a, Entry<T>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> Iterator for Drain<'a, T> {
|
impl<T> Iterator for Drain<'_, T> {
|
||||||
type Item = (Index, T);
|
type Item = (Index, T);
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ fn edges_walker_mut<E>(
|
|||||||
EdgesWalkerMut { edges, next, dir }
|
EdgesWalkerMut { edges, next, dir }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, E> EdgesWalkerMut<'a, E> {
|
impl<E> EdgesWalkerMut<'_, E> {
|
||||||
fn next_edge(&mut self) -> Option<&mut Edge<E>> {
|
fn next_edge(&mut self) -> Option<&mut Edge<E>> {
|
||||||
self.next().map(|t| t.1)
|
self.next().map(|t| t.1)
|
||||||
}
|
}
|
||||||
@@ -630,7 +630,7 @@ impl<'a, E> Iterator for Edges<'a, E> {
|
|||||||
// x
|
// x
|
||||||
// }
|
// }
|
||||||
|
|
||||||
impl<'a, E> Clone for Edges<'a, E> {
|
impl<E> Clone for Edges<'_, E> {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
Edges {
|
Edges {
|
||||||
skip_start: self.skip_start,
|
skip_start: self.skip_start,
|
||||||
@@ -699,15 +699,15 @@ impl<'a, E: 'a> EdgeReference<'a, E> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, E> Clone for EdgeReference<'a, E> {
|
impl<E> Clone for EdgeReference<'_, E> {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
*self
|
*self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, E> Copy for EdgeReference<'a, E> {}
|
impl<E> Copy for EdgeReference<'_, E> {}
|
||||||
|
|
||||||
impl<'a, E> PartialEq for EdgeReference<'a, E>
|
impl<E> PartialEq for EdgeReference<'_, E>
|
||||||
where
|
where
|
||||||
E: PartialEq,
|
E: PartialEq,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use na::{DVector, Matrix2};
|
|||||||
|
|
||||||
use super::{TwoBodyConstraintElement, TwoBodyConstraintNormalPart};
|
use super::{TwoBodyConstraintElement, TwoBodyConstraintNormalPart};
|
||||||
|
|
||||||
impl<'a> AnyConstraintMut<'a, ContactConstraintTypes> {
|
impl AnyConstraintMut<'_, ContactConstraintTypes> {
|
||||||
pub fn remove_bias(&mut self) {
|
pub fn remove_bias(&mut self) {
|
||||||
match self {
|
match self {
|
||||||
Self::OneBody(c) => c.remove_cfm_and_bias_from_rhs(),
|
Self::OneBody(c) => c.remove_cfm_and_bias_from_rhs(),
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ pub(crate) trait PairInteraction {
|
|||||||
use crate::dynamics::RigidBodyType;
|
use crate::dynamics::RigidBodyType;
|
||||||
|
|
||||||
#[cfg(feature = "parallel")]
|
#[cfg(feature = "parallel")]
|
||||||
impl<'a> PairInteraction for &'a mut ContactManifold {
|
impl PairInteraction for &mut ContactManifold {
|
||||||
fn body_pair(&self) -> (Option<RigidBodyHandle>, Option<RigidBodyHandle>) {
|
fn body_pair(&self) -> (Option<RigidBodyHandle>, Option<RigidBodyHandle>) {
|
||||||
(self.data.rigid_body1, self.data.rigid_body2)
|
(self.data.rigid_body1, self.data.rigid_body2)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ use crate::dynamics::solver::joint_constraint::joint_constraint_builder::{
|
|||||||
|
|
||||||
pub struct JointConstraintTypes;
|
pub struct JointConstraintTypes;
|
||||||
|
|
||||||
impl<'a> AnyConstraintMut<'a, JointConstraintTypes> {
|
impl AnyConstraintMut<'_, JointConstraintTypes> {
|
||||||
pub fn remove_bias(&mut self) {
|
pub fn remove_bias(&mut self) {
|
||||||
match self {
|
match self {
|
||||||
Self::OneBody(c) => c.remove_bias_from_rhs(),
|
Self::OneBody(c) => c.remove_bias_from_rhs(),
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ pub struct ContactModificationContext<'a> {
|
|||||||
pub user_data: &'a mut u32,
|
pub user_data: &'a mut u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> ContactModificationContext<'a> {
|
impl ContactModificationContext<'_> {
|
||||||
/// Helper function to update `self` to emulate a oneway-platform.
|
/// Helper function to update `self` to emulate a oneway-platform.
|
||||||
///
|
///
|
||||||
/// The "oneway" behavior will only allow contacts between two colliders
|
/// The "oneway" behavior will only allow contacts between two colliders
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ pub struct SweptAabbWithPredictedPosition<'a> {
|
|||||||
/// You probably want to set it to [`IntegrationParameters::dt`].
|
/// You probably want to set it to [`IntegrationParameters::dt`].
|
||||||
pub dt: Real,
|
pub dt: Real,
|
||||||
}
|
}
|
||||||
impl<'a> QbvhDataGenerator<ColliderHandle> for SweptAabbWithPredictedPosition<'a> {
|
impl QbvhDataGenerator<ColliderHandle> for SweptAabbWithPredictedPosition<'_> {
|
||||||
fn size_hint(&self) -> usize {
|
fn size_hint(&self) -> usize {
|
||||||
self.colliders.len()
|
self.colliders.len()
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ pub struct SweptAabbWithNextPosition<'a> {
|
|||||||
pub colliders: &'a ColliderSet,
|
pub colliders: &'a ColliderSet,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> QbvhDataGenerator<ColliderHandle> for SweptAabbWithNextPosition<'a> {
|
impl QbvhDataGenerator<ColliderHandle> for SweptAabbWithNextPosition<'_> {
|
||||||
fn size_hint(&self) -> usize {
|
fn size_hint(&self) -> usize {
|
||||||
self.colliders.len()
|
self.colliders.len()
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ pub struct CurrentAabb<'a> {
|
|||||||
pub colliders: &'a ColliderSet,
|
pub colliders: &'a ColliderSet,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> QbvhDataGenerator<ColliderHandle> for CurrentAabb<'a> {
|
impl QbvhDataGenerator<ColliderHandle> for CurrentAabb<'_> {
|
||||||
fn size_hint(&self) -> usize {
|
fn size_hint(&self) -> usize {
|
||||||
self.colliders.len()
|
self.colliders.len()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ pub struct QueryFilter<'a> {
|
|||||||
pub predicate: Option<&'a dyn Fn(ColliderHandle, &Collider) -> bool>,
|
pub predicate: Option<&'a dyn Fn(ColliderHandle, &Collider) -> bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> QueryFilter<'a> {
|
impl QueryFilter<'_> {
|
||||||
/// Applies the filters described by `self` to a collider to determine if it has to be
|
/// Applies the filters described by `self` to a collider to determine if it has to be
|
||||||
/// included in a scene query (`true`) or not (`false`).
|
/// included in a scene query (`true`) or not (`false`).
|
||||||
#[inline]
|
#[inline]
|
||||||
@@ -136,7 +136,7 @@ impl<'a> QueryFilter<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> From<QueryFilterFlags> for QueryFilter<'a> {
|
impl From<QueryFilterFlags> for QueryFilter<'_> {
|
||||||
fn from(flags: QueryFilterFlags) -> Self {
|
fn from(flags: QueryFilterFlags) -> Self {
|
||||||
Self {
|
Self {
|
||||||
flags,
|
flags,
|
||||||
@@ -145,7 +145,7 @@ impl<'a> From<QueryFilterFlags> for QueryFilter<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> From<InteractionGroups> for QueryFilter<'a> {
|
impl From<InteractionGroups> for QueryFilter<'_> {
|
||||||
fn from(groups: InteractionGroups) -> Self {
|
fn from(groups: InteractionGroups) -> Self {
|
||||||
Self {
|
Self {
|
||||||
groups: Some(groups),
|
groups: Some(groups),
|
||||||
@@ -229,7 +229,7 @@ impl<'a> QueryFilter<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> TypedSimdCompositeShape for QueryPipelineAsCompositeShape<'a> {
|
impl TypedSimdCompositeShape for QueryPipelineAsCompositeShape<'_> {
|
||||||
type PartShape = dyn Shape;
|
type PartShape = dyn Shape;
|
||||||
type PartNormalConstraints = dyn NormalConstraints;
|
type PartNormalConstraints = dyn NormalConstraints;
|
||||||
type PartId = ColliderHandle;
|
type PartId = ColliderHandle;
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ impl TestbedApp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'b, 'c, 'd, 'e, 'f> TestbedGraphics<'a, 'b, 'c, 'd, 'e, 'f> {
|
impl TestbedGraphics<'_, '_, '_, '_, '_, '_> {
|
||||||
pub fn set_body_color(&mut self, body: RigidBodyHandle, color: [f32; 3]) {
|
pub fn set_body_color(&mut self, body: RigidBodyHandle, color: [f32; 3]) {
|
||||||
self.graphics.set_body_color(self.materials, body, color);
|
self.graphics.set_body_color(self.materials, body, color);
|
||||||
}
|
}
|
||||||
@@ -526,7 +526,7 @@ impl<'a, 'b, 'c, 'd, 'e, 'f> TestbedGraphics<'a, 'b, 'c, 'd, 'e, 'f> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'b, 'c, 'd, 'e, 'f> Testbed<'a, 'b, 'c, 'd, 'e, 'f> {
|
impl Testbed<'_, '_, '_, '_, '_, '_> {
|
||||||
pub fn set_number_of_steps_per_frame(&mut self, nsteps: usize) {
|
pub fn set_number_of_steps_per_frame(&mut self, nsteps: usize) {
|
||||||
self.state.nsteps = nsteps
|
self.state.nsteps = nsteps
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user