Skip to content

Commit

Permalink
Merge pull request amethyst#2656 from grzi/fix/clippy_error_on_spotlight
Browse files Browse the repository at this point in the history
fix: clippy and fmt
  • Loading branch information
suspistew authored Mar 8, 2021
2 parents 3bdc66b + 7312586 commit eae7d26
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
5 changes: 3 additions & 2 deletions amethyst_assets/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,11 @@ impl IndirectionResolver for AssetIndirectionResolver {
) -> Option<AssetUuid> {
let id_type = id.type_id();
for candidate in candidates {
let candidate_assets_len = candidate.1.len();
let candidate_assets_len = candidate.1.len();
for asset in candidate.1 {
if let Some(artifact) = asset.artifact {
if id_type.is_none() || candidate_assets_len == 1
if id_type.is_none()
|| candidate_assets_len == 1
|| *id_type.unwrap() == artifact.type_id
{
return Some(asset.id);
Expand Down
14 changes: 7 additions & 7 deletions amethyst_assets/src/prefab/component_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ impl ComponentRegistryBuilder {
FromT: Component,
IntoT: Component,
F: Fn(
&Resources, // resources
Range<usize>, // src_entity_range
&Archetype, // src_arch
&Components, // src_components
&mut ComponentWriter<'_, IntoT>, // dst
fn(&mut ComponentWriter<'_, IntoT>, IntoT), // push_fn
) + Send
&Resources, // resources
Range<usize>, // src_entity_range
&Archetype, // src_arch
&Components, // src_components
&mut ComponentWriter<'_, IntoT>, // dst
fn(&mut ComponentWriter<'_, IntoT>, IntoT), // push_fn
) + Send
+ Sync
+ 'static,
{
Expand Down
2 changes: 1 addition & 1 deletion amethyst_gltf/src/importer/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub fn load_animations(
.entry(animation_entity)
.expect("Unreachable: `animation_entity` is initialized previously")
.add_component(AnimationSet::<usize, Transform> {
animations: animations_accumulator.clone(),
animations: animations_accumulator,
});

asset_accumulator
Expand Down
3 changes: 2 additions & 1 deletion examples/spotlights/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ mod example_utils {
Camera, Material, MaterialDefaults, Mesh, Texture,
},
};
use amethyst::core::num::FloatConst;

pub fn build_mesh_from_shape(world: &mut World, resources: &mut Resources) {
let loader = resources.get::<DefaultLoader>().unwrap();
Expand Down Expand Up @@ -195,7 +196,7 @@ mod example_utils {

world.push((
camera_transform,
Camera::perspective(1.3, 1.0471975512, 0.1),
Camera::perspective(1.3, f32::FRAC_PI_3(), 0.1),
));
}
}

0 comments on commit eae7d26

Please sign in to comment.