Fix beta CI (#16984)

# Objective

Fixes #16607

## Solution

Satisfy clippy

## Testing

Ran clippy
This commit is contained in:
Benjamin Brienen 2024-12-26 23:17:51 +01:00 committed by GitHub
parent cae2da3cee
commit 1675d68366
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 10 additions and 18 deletions

View File

@ -280,7 +280,7 @@ unsafe impl<A: AsAssetId> QueryFilter for AssetChanged<A> {
entity: Entity,
table_row: TableRow,
) -> bool {
fetch.inner.as_mut().map_or(false, |inner| {
fetch.inner.as_mut().is_some_and(|inner| {
// SAFETY: We delegate to the inner `fetch` for `A`
unsafe {
let handle = <&A>::fetch(inner, entity, table_row);

View File

@ -36,10 +36,10 @@ pub fn derive_query_data_impl(input: TokenStream) -> TokenStream {
let mut attributes = QueryDataAttributes::default();
for attr in &ast.attrs {
if !attr
if attr
.path()
.get_ident()
.map_or(false, |ident| ident == QUERY_DATA_ATTRIBUTE_NAME)
.is_none_or(|ident| ident != QUERY_DATA_ATTRIBUTE_NAME)
{
continue;
}
@ -382,7 +382,7 @@ fn read_world_query_field_info(field: &Field) -> syn::Result<QueryDataFieldInfo>
if attr
.path()
.get_ident()
.map_or(false, |ident| ident == QUERY_DATA_ATTRIBUTE_NAME)
.is_some_and(|ident| ident == QUERY_DATA_ATTRIBUTE_NAME)
{
return Err(syn::Error::new_spanned(
attr,

View File

@ -804,7 +804,7 @@ impl Entities {
// not reallocated since the generation is incremented in `free`
pub fn contains(&self, entity: Entity) -> bool {
self.resolve_from_id(entity.index())
.map_or(false, |e| e.generation() == entity.generation())
.is_some_and(|e| e.generation() == entity.generation())
}
/// Clears all [`Entity`] from the World.

View File

@ -78,7 +78,7 @@ impl<'w, D: QueryData, F: QueryFilter> QueryBuilder<'w, D, F> {
self.world()
.components()
.get_info(component_id)
.map_or(false, |info| info.storage_type() == StorageType::Table)
.is_some_and(|info| info.storage_type() == StorageType::Table)
};
#[allow(deprecated)]

View File

@ -168,14 +168,8 @@ impl Stepping {
if self.action == Action::RunAll {
return None;
}
let label = match self.schedule_order.get(self.cursor.schedule) {
None => return None,
Some(label) => label,
};
let state = match self.schedule_states.get(label) {
None => return None,
Some(state) => state,
};
let label = self.schedule_order.get(self.cursor.schedule)?;
let state = self.schedule_states.get(label)?;
state
.node_ids
.get(self.cursor.system)

View File

@ -424,7 +424,7 @@ fn visibility_propagate_system(
// fall back to true if no parent is found or parent lacks components
Visibility::Inherited => parent
.and_then(|p| visibility_query.get(p.get()).ok())
.map_or(true, |(_, x)| x.get()),
.is_none_or(|(_, x)| x.get()),
};
let (_, mut inherited_visibility) = visibility_query
.get_mut(entity)

View File

@ -92,9 +92,7 @@ impl FontAtlasSet {
pub fn has_glyph(&self, cache_key: cosmic_text::CacheKey, font_size: &FontAtlasKey) -> bool {
self.font_atlases
.get(font_size)
.map_or(false, |font_atlas| {
font_atlas.iter().any(|atlas| atlas.has_glyph(cache_key))
})
.is_some_and(|font_atlas| font_atlas.iter().any(|atlas| atlas.has_glyph(cache_key)))
}
/// Adds the given subpixel-offset glyph to the [`FontAtlas`]es in this set