Nightly clippy fixes (#3491)
Fixes the following nightly clippy lints: - ~~[map_flatten](https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten)~~ (Fixed on main) - ~~[needless_borrow](https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow)~~ (Fixed on main) - [return_self_not_must_use](https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use) (Added in 1.59.0) - ~~[unnecessary_lazy_evaluations](https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations)~~ (Fixed on main) - [extra_unused_lifetimes](https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes) outside of macros - [let_unit_value](https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value)
This commit is contained in:
parent
b1b3bd533b
commit
dbd856de71
@ -840,7 +840,7 @@ impl<'w, T: Component> WorldQueryGats<'w> for &mut T {
|
|||||||
type _State = WriteState<T>;
|
type _State = WriteState<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'w, 's, T: Component> Fetch<'w> for WriteFetch<'w, T> {
|
impl<'w, T: Component> Fetch<'w> for WriteFetch<'w, T> {
|
||||||
type Item = Mut<'w, T>;
|
type Item = Mut<'w, T>;
|
||||||
type State = WriteState<T>;
|
type State = WriteState<T>;
|
||||||
|
|
||||||
|
@ -510,11 +510,11 @@ unsafe impl ReadOnlySystemParamFetch for WorldState {}
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub struct WorldState;
|
pub struct WorldState;
|
||||||
|
|
||||||
impl<'w, 's> SystemParam for &'w World {
|
impl<'w> SystemParam for &'w World {
|
||||||
type Fetch = WorldState;
|
type Fetch = WorldState;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<'w, 's> SystemParamState for WorldState {
|
unsafe impl SystemParamState for WorldState {
|
||||||
fn init(_world: &mut World, system_meta: &mut SystemMeta) -> Self {
|
fn init(_world: &mut World, system_meta: &mut SystemMeta) -> Self {
|
||||||
let mut access = Access::default();
|
let mut access = Access::default();
|
||||||
access.read_all();
|
access.read_all();
|
||||||
@ -1365,7 +1365,7 @@ impl<'w, 's, P: SystemParam> StaticSystemParam<'w, 's, P> {
|
|||||||
pub struct StaticSystemParamState<S, P>(S, PhantomData<fn() -> P>);
|
pub struct StaticSystemParamState<S, P>(S, PhantomData<fn() -> P>);
|
||||||
|
|
||||||
// Safe: This doesn't add any more reads, and the delegated fetch confirms it
|
// Safe: This doesn't add any more reads, and the delegated fetch confirms it
|
||||||
unsafe impl<'w, 's, S: ReadOnlySystemParamFetch, P> ReadOnlySystemParamFetch
|
unsafe impl<S: ReadOnlySystemParamFetch, P> ReadOnlySystemParamFetch
|
||||||
for StaticSystemParamState<S, P>
|
for StaticSystemParamState<S, P>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -1394,7 +1394,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl<'w, 's, S: SystemParamState, P: SystemParam + 'static> SystemParamState
|
unsafe impl<S: SystemParamState, P: SystemParam + 'static> SystemParamState
|
||||||
for StaticSystemParamState<S, P>
|
for StaticSystemParamState<S, P>
|
||||||
{
|
{
|
||||||
fn init(world: &mut World, system_meta: &mut SystemMeta) -> Self {
|
fn init(world: &mut World, system_meta: &mut SystemMeta) -> Self {
|
||||||
|
@ -74,7 +74,7 @@ impl<'w> Drop for WorldCell<'w> {
|
|||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let mut access = self.access.borrow_mut();
|
let mut access = self.access.borrow_mut();
|
||||||
// give world ArchetypeComponentAccess back to reuse allocations
|
// give world ArchetypeComponentAccess back to reuse allocations
|
||||||
let _ = std::mem::swap(&mut self.world.archetype_component_access, &mut *access);
|
std::mem::swap(&mut self.world.archetype_component_access, &mut *access);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ impl<'a> Iterator for ArrayIter<'a> {
|
|||||||
|
|
||||||
impl<'a> ExactSizeIterator for ArrayIter<'a> {}
|
impl<'a> ExactSizeIterator for ArrayIter<'a> {}
|
||||||
|
|
||||||
impl<'a> serde::Serialize for dyn Array {
|
impl serde::Serialize for dyn Array {
|
||||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
where
|
where
|
||||||
S: serde::Serializer,
|
S: serde::Serializer,
|
||||||
|
@ -76,6 +76,7 @@ impl RenderLayers {
|
|||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
/// Panics when called with a layer greater than `TOTAL_LAYERS - 1`.
|
/// Panics when called with a layer greater than `TOTAL_LAYERS - 1`.
|
||||||
|
#[must_use]
|
||||||
pub const fn with(mut self, layer: Layer) -> Self {
|
pub const fn with(mut self, layer: Layer) -> Self {
|
||||||
assert!((layer as usize) < Self::TOTAL_LAYERS);
|
assert!((layer as usize) < Self::TOTAL_LAYERS);
|
||||||
self.0 |= 1 << layer;
|
self.0 |= 1 << layer;
|
||||||
@ -86,6 +87,7 @@ impl RenderLayers {
|
|||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
/// Panics when called with a layer greater than `TOTAL_LAYERS - 1`.
|
/// Panics when called with a layer greater than `TOTAL_LAYERS - 1`.
|
||||||
|
#[must_use]
|
||||||
pub const fn without(mut self, layer: Layer) -> Self {
|
pub const fn without(mut self, layer: Layer) -> Self {
|
||||||
assert!((layer as usize) < Self::TOTAL_LAYERS);
|
assert!((layer as usize) < Self::TOTAL_LAYERS);
|
||||||
self.0 &= !(1 << layer);
|
self.0 &= !(1 << layer);
|
||||||
|
@ -102,6 +102,7 @@ impl GlobalTransform {
|
|||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
pub const fn with_translation(mut self, translation: Vec3) -> Self {
|
pub const fn with_translation(mut self, translation: Vec3) -> Self {
|
||||||
self.translation = translation;
|
self.translation = translation;
|
||||||
self
|
self
|
||||||
@ -109,6 +110,7 @@ impl GlobalTransform {
|
|||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
pub const fn with_rotation(mut self, rotation: Quat) -> Self {
|
pub const fn with_rotation(mut self, rotation: Quat) -> Self {
|
||||||
self.rotation = rotation;
|
self.rotation = rotation;
|
||||||
self
|
self
|
||||||
@ -116,6 +118,7 @@ impl GlobalTransform {
|
|||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
pub const fn with_scale(mut self, scale: Vec3) -> Self {
|
pub const fn with_scale(mut self, scale: Vec3) -> Self {
|
||||||
self.scale = scale;
|
self.scale = scale;
|
||||||
self
|
self
|
||||||
|
@ -112,6 +112,7 @@ impl Transform {
|
|||||||
|
|
||||||
/// Returns this [`Transform`] with a new translation.
|
/// Returns this [`Transform`] with a new translation.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
pub const fn with_translation(mut self, translation: Vec3) -> Self {
|
pub const fn with_translation(mut self, translation: Vec3) -> Self {
|
||||||
self.translation = translation;
|
self.translation = translation;
|
||||||
self
|
self
|
||||||
@ -119,6 +120,7 @@ impl Transform {
|
|||||||
|
|
||||||
/// Returns this [`Transform`] with a new rotation.
|
/// Returns this [`Transform`] with a new rotation.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
pub const fn with_rotation(mut self, rotation: Quat) -> Self {
|
pub const fn with_rotation(mut self, rotation: Quat) -> Self {
|
||||||
self.rotation = rotation;
|
self.rotation = rotation;
|
||||||
self
|
self
|
||||||
@ -126,6 +128,7 @@ impl Transform {
|
|||||||
|
|
||||||
/// Returns this [`Transform`] with a new scale.
|
/// Returns this [`Transform`] with a new scale.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
pub const fn with_scale(mut self, scale: Vec3) -> Self {
|
pub const fn with_scale(mut self, scale: Vec3) -> Self {
|
||||||
self.scale = scale;
|
self.scale = scale;
|
||||||
self
|
self
|
||||||
|
Loading…
Reference in New Issue
Block a user