bevy_platform: clippy without default features (#19860)

# Objective

- bevy_platform has clippy warnings when building without default
features

## Solution

- Fix them

## Testing

`cargo clippy -p bevy_platform --no-default-features --no-deps -- -D
warnings`
This commit is contained in:
François Mockers 2025-06-29 19:12:57 +02:00 committed by GitHub
parent 1fe559730c
commit 5f497efe90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ crate::cfg::switch! {
let start = Instant::now();
while start.elapsed() < dur {
spin_loop()
spin_loop();
}
}
}

View File

@ -155,14 +155,14 @@ fn unset_getter() -> Duration {
let nanos = unsafe {
core::arch::x86::_rdtsc()
};
return Duration::from_nanos(nanos);
Duration::from_nanos(nanos)
}
#[cfg(target_arch = "x86_64")] => {
// SAFETY: standard technique for getting a nanosecond counter on x86_64
let nanos = unsafe {
core::arch::x86_64::_rdtsc()
};
return Duration::from_nanos(nanos);
Duration::from_nanos(nanos)
}
#[cfg(target_arch = "aarch64")] => {
// SAFETY: standard technique for getting a nanosecond counter of aarch64
@ -171,7 +171,7 @@ fn unset_getter() -> Duration {
core::arch::asm!("mrs {}, cntvct_el0", out(reg) ticks);
ticks
};
return Duration::from_nanos(nanos);
Duration::from_nanos(nanos)
}
_ => {
panic!("An elapsed time getter has not been provided to `Instant`. Please use `Instant::set_elapsed(...)` before calling `Instant::now()`")