Skip to content

Commit 10d72fc

Browse files
zicklagTekhnaeRaav
andauthored
fix: resolve clippy lints. (#513)
Co-authored-by: Tekhnae Raav <tekhnaeraav@katharostech.com>
1 parent f30e1b1 commit 10d72fc

9 files changed

Lines changed: 113 additions & 177 deletions

File tree

framework_crates/bones_asset/src/server.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,7 @@ impl AssetServer {
896896
SchemaMismatchError,
897897
>,
898898
> {
899-
let cid = match self.store.asset_ids.get(&handle.untyped()) {
900-
Some(cid) => cid,
901-
None => return None,
902-
};
899+
let cid = self.store.asset_ids.get(&handle.untyped())?;
903900
Some(
904901
MapRef::try_map(self.store.assets.get(&cid).unwrap(), |x| {
905902
let asset = &x.data;

framework_crates/bones_ecs/src/components/typed.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,6 @@ mod tests {
311311
#[repr(C)]
312312
struct A(u32);
313313

314-
#[derive(Debug, Clone, Copy, PartialEq, Eq, HasSchema, Default)]
315-
#[repr(C)]
316-
struct B(u32);
317-
318314
fn entity(index: u32) -> Entity {
319315
Entity::new(index, 0)
320316
}

framework_crates/bones_ecs/src/system.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ mod tests {
464464
assert!(d.as_deref() == Some(&2));
465465
}
466466

467-
let mut world = World::new();
467+
let world = World::new();
468468
world.insert_resource(1u16);
469469
world.insert_resource(2u64);
470470
world.run_system(access_resource, ());
@@ -480,7 +480,7 @@ mod tests {
480480
**n *= 3;
481481
}
482482

483-
let mut world = World::new();
483+
let world = World::new();
484484
world.insert_resource(2usize);
485485

486486
let result = world.run_system(mul_by_res, 3);

framework_crates/bones_framework/src/audio/audio_center.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,10 @@ pub fn _process_audio_events(
308308
force_restart,
309309
} => {
310310
let should_play = force_restart
311-
|| audio_center.music.as_ref().map_or(true, |current_music| {
312-
sound_source != current_music.bones_handle
313-
});
311+
|| audio_center
312+
.music
313+
.as_ref()
314+
.is_none_or(|current_music| sound_source != current_music.bones_handle);
314315

315316
if should_play {
316317
// Stop the current music

framework_crates/bones_framework/src/localization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl AssetLoader for LocalizationLoader {
256256
.unwrap_or(en_us.clone());
257257

258258
let selected_locale = fluent_langneg::negotiate_languages(
259-
&[user_locale.clone()],
259+
std::slice::from_ref(&user_locale),
260260
&available_locales,
261261
Some(&en_us),
262262
fluent_langneg::NegotiationStrategy::Filtering,

0 commit comments

Comments
 (0)