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( #![allow(
renamed_and_removed_lints, renamed_and_removed_lints,
unknown_lints,
clippy::unknown_clippy_lints, clippy::unknown_clippy_lints,
clippy::inconsistent_struct_constructor,
clippy::manual_map,
clippy::manual_range_contains, clippy::manual_range_contains,
clippy::same_item_push, clippy::same_item_push,
clippy::unnecessary_wraps clippy::unnecessary_wraps

View File

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

View File

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

View File

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

View File

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

View File

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