Skip to content
This repository was archived by the owner on Feb 19, 2026. It is now read-only.

Commit 523b1e2

Browse files
committed
Make current nightly rustc and Clippy happy.
1 parent efca590 commit 523b1e2

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/archetype.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use std::alloc::{alloc, dealloc, handle_alloc_error, Layout};
22
use std::any::TypeId;
33
use std::cmp::Reverse;
44
use std::mem::{align_of, needs_drop, transmute};
5-
use std::ptr::{copy_nonoverlapping, drop_in_place};
6-
use std::slice::from_raw_parts_mut;
5+
use std::ptr::{copy_nonoverlapping, drop_in_place, slice_from_raw_parts_mut};
76

87
use crate::{resources::TypeIdMap, world::Entity};
98

@@ -328,7 +327,7 @@ impl TypeMetadata {
328327
C: 'static,
329328
{
330329
unsafe fn drop<C>(ptr: *mut u8, len: usize) {
331-
drop_in_place(from_raw_parts_mut(ptr.cast::<C>(), len))
330+
drop_in_place(slice_from_raw_parts_mut(ptr.cast::<C>(), len))
332331
}
333332

334333
Self {
@@ -387,7 +386,7 @@ fn alloc_ptr(layout: Layout) -> *mut u8 {
387386

388387
fn invalid_ptr(addr: usize) -> *mut u8 {
389388
unsafe {
390-
#[allow(clippy::useless_transmute)]
389+
#[allow(integer_to_ptr_transmutes)]
391390
transmute(addr)
392391
}
393392
}

src/query.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ where
163163
QueryRef {
164164
world,
165165
_ref,
166+
#[allow(clippy::missing_transmute_annotations)]
166167
comps: unsafe { transmute(&*self.comps) },
168+
#[allow(clippy::missing_transmute_annotations)]
167169
ptrs: unsafe { transmute(&mut *self.ptrs) },
168170
}
169171
}
@@ -482,15 +484,15 @@ where
482484
/// assert_eq!(*i2, 23);
483485
/// assert_eq!(f2.copied(), None);
484486
/// ```
485-
pub fn get(&self, ent: Entity) -> Option<<S::Fetch as Fetch>::Item>
487+
pub fn get(&self, ent: Entity) -> Option<<S::Fetch as Fetch<'_>>::Item>
486488
where
487489
S::Fetch: FetchShared,
488490
{
489491
unsafe { self.get_unchecked(ent) }
490492
}
491493

492494
/// Exclusively access the queried components of the given [Entity]
493-
pub fn get_mut(&mut self, ent: Entity) -> Option<<S::Fetch as Fetch>::Item> {
495+
pub fn get_mut(&mut self, ent: Entity) -> Option<<S::Fetch as Fetch<'_>>::Item> {
494496
unsafe { self.get_unchecked(ent) }
495497
}
496498

@@ -520,7 +522,7 @@ where
520522
pub fn get_many_mut<const N: usize>(
521523
&mut self,
522524
ent: [Entity; N],
523-
) -> [Option<<S::Fetch as Fetch>::Item>; N] {
525+
) -> [Option<<S::Fetch as Fetch<'_>>::Item>; N] {
524526
let mut val = MaybeUninit::uninit();
525527

526528
let ptr = val.as_mut_ptr() as *mut Option<<S::Fetch as Fetch>::Item>;

src/world.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ impl World {
502502
/// let comp = world.query_one::<&u32>(entity).unwrap();
503503
/// assert_eq!(*comp.get(), 42);
504504
/// ```
505-
pub fn query_one<S>(&self, ent: Entity) -> Option<QueryOne<S>>
505+
pub fn query_one<S>(&self, ent: Entity) -> Option<QueryOne<'_, S>>
506506
where
507507
S: QuerySpec,
508508
{

0 commit comments

Comments
 (0)