Fix rust beta lints (#14537)
# Objective - Fixes #14517. ## Solution - Replace two instances of `map()` with `inspect()`. - `#[allow(dead_code)]` on `Bundle` derive macro tests. ## Testing You need to install the beta toolchain, since these lints are not stable yet. ```bash cargo +beta clippy --workspace cargo +beta test --workspace ```
This commit is contained in:
parent
3d1c9ca87f
commit
399219a2c7
@ -193,10 +193,7 @@ impl<A: Asset> DenseAssetStorage<A> {
|
|||||||
Entry::None => return None,
|
Entry::None => return None,
|
||||||
Entry::Some { value, generation } => {
|
Entry::Some { value, generation } => {
|
||||||
if *generation == index.generation {
|
if *generation == index.generation {
|
||||||
value.take().map(|value| {
|
value.take().inspect(|_| self.len -= 1)
|
||||||
self.len -= 1;
|
|
||||||
value
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ impl AssetServer {
|
|||||||
let (mut meta, loader, mut reader) = self
|
let (mut meta, loader, mut reader) = self
|
||||||
.get_meta_loader_and_reader(&path_clone, asset_type_id)
|
.get_meta_loader_and_reader(&path_clone, asset_type_id)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| {
|
.inspect_err(|e| {
|
||||||
// if there was an input handle, a "load" operation has already started, so we must produce a "failure" event, if
|
// if there was an input handle, a "load" operation has already started, so we must produce a "failure" event, if
|
||||||
// we cannot find the meta and loader
|
// we cannot find the meta and loader
|
||||||
if let Some(handle) = &input_handle {
|
if let Some(handle) = &input_handle {
|
||||||
@ -510,7 +510,6 @@ impl AssetServer {
|
|||||||
error: e.clone(),
|
error: e.clone(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
e
|
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
// This contains Some(UntypedHandle), if it was retrievable
|
// This contains Some(UntypedHandle), if it was retrievable
|
||||||
|
@ -1741,7 +1741,8 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// These fields are never read so we get a dead code lint here.
|
// These structs are primarily compilation tests to test the derive macros. Because they are
|
||||||
|
// never constructed, we have to manually silence the `dead_code` lint.
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
struct ComponentA(u32);
|
struct ComponentA(u32);
|
||||||
@ -1750,12 +1751,15 @@ mod tests {
|
|||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
struct ComponentB(u32);
|
struct ComponentB(u32);
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[derive(Bundle)]
|
#[derive(Bundle)]
|
||||||
struct Simple(ComponentA);
|
struct Simple(ComponentA);
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[derive(Bundle)]
|
#[derive(Bundle)]
|
||||||
struct Tuple(Simple, ComponentB);
|
struct Tuple(Simple, ComponentB);
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[derive(Bundle)]
|
#[derive(Bundle)]
|
||||||
struct Record {
|
struct Record {
|
||||||
field0: Simple,
|
field0: Simple,
|
||||||
|
Loading…
Reference in New Issue
Block a user