chore: Appease clippy

This commit is contained in:
Mike Welsh 2021-02-27 14:50:44 -08:00
parent 8500a676cf
commit 3099914374
6 changed files with 13 additions and 18 deletions

View File

@ -1,6 +1,9 @@
#![allow(
renamed_and_removed_lints,
unknown_lints,
clippy::unknown_clippy_lints,
clippy::inconsistent_struct_constructor,
clippy::manual_map,
clippy::manual_range_contains,
clippy::same_item_push,
clippy::unnecessary_wraps

View File

@ -421,12 +421,8 @@ impl AudioBackend for CpalAudioBackend {
fn get_sound_position(&self, instance: SoundInstanceHandle) -> Option<u32> {
let sound_instances = self.sound_instances.lock().unwrap();
if let Some(_instance) = sound_instances.get(instance) {
// TODO: Return actual position
Some(0)
} else {
None
}
sound_instances.get(instance).map(|_| 0)
}
fn get_sound_duration(&self, sound: SoundHandle) -> Option<u32> {

View File

@ -454,9 +454,9 @@ impl WebGlRenderBackend {
gl.bind_framebuffer(Gl2::FRAMEBUFFER, None);
self.msaa_buffers = Some(MsaaBuffers {
render_framebuffer,
color_renderbuffer,
stencil_renderbuffer,
render_framebuffer,
color_framebuffer,
framebuffer_texture,
});
@ -744,9 +744,9 @@ impl WebGlRenderBackend {
self.bitmap_registry.insert(handle, bitmap);
self.textures.push(Texture {
texture,
width,
height,
texture,
});
Ok(BitmapInfo {

View File

@ -749,9 +749,9 @@ impl<T: RenderTarget> WgpuRenderBackend<T> {
self.bitmap_registry.insert(handle, bitmap);
self.textures.push(Texture {
texture,
width,
height,
texture,
bind_group,
});

View File

@ -1777,11 +1777,11 @@ impl<'a> Reader<'a> {
start_cap,
end_cap,
join_style,
fill_style,
allow_scale_x,
allow_scale_y,
is_pixel_hinted,
allow_close,
fill_style,
})
}
}
@ -2397,8 +2397,8 @@ impl<'a> Reader<'a> {
Ok(SoundFormat {
compression,
sample_rate,
is_16_bit,
is_stereo,
is_16_bit,
})
}
@ -2671,8 +2671,8 @@ impl<'a> Reader<'a> {
let data = self.read_slice(data_size)?;
let alpha_data = self.read_slice_to_end();
Ok(Tag::DefineBitsJpeg3(DefineBitsJpeg3 {
version,
id,
version,
deblocking,
data,
alpha_data,

View File

@ -1022,12 +1022,8 @@ impl AudioBackend for WebAudioBackend {
fn get_sound_position(&self, instance: SoundInstanceHandle) -> Option<u32> {
SOUND_INSTANCES.with(|instances| {
let instances = instances.borrow();
if let Some(_instance) = instances.get(instance) {
// TODO: Return actual position
Some(0)
} else {
None
}
instances.get(instance).map(|_| 0)
})
}