bevy_ecs: remove use of needless_return (#19859)
# Objective - bevy_ecs has a expected lint that is both needed and unneeded ## Solution - Change the logic so that it's always not needed ## Testing `cargo clippy -p bevy_ecs --no-default-features --no-deps -- -D warnings`
This commit is contained in:
parent
8e12b1f0b2
commit
1fe559730c
@ -64,17 +64,7 @@ impl<const SEND: bool> ResourceData<SEND> {
|
||||
/// If `SEND` is false, this will panic if called from a different thread than the one it was inserted from.
|
||||
#[inline]
|
||||
fn validate_access(&self) {
|
||||
if SEND {
|
||||
#[cfg_attr(
|
||||
not(feature = "std"),
|
||||
expect(
|
||||
clippy::needless_return,
|
||||
reason = "needless until no_std is addressed (see below)",
|
||||
)
|
||||
)]
|
||||
return;
|
||||
}
|
||||
|
||||
if !SEND {
|
||||
#[cfg(feature = "std")]
|
||||
if self.origin_thread_id != Some(std::thread::current().id()) {
|
||||
// Panic in tests, as testing for aborting is nearly impossible
|
||||
@ -91,6 +81,7 @@ impl<const SEND: bool> ResourceData<SEND> {
|
||||
// To support no_std multithreading, an alternative will be required.
|
||||
// Remove the #[expect] attribute above when this is addressed.
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if the resource is populated.
|
||||
#[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user