refactor: resolve clippy::explicit_auto_deref

This commit is contained in:
Erich Gubler
2022-11-07 10:27:46 -05:00
committed by Jim Blandy
parent 98eb19c854
commit fb67de908e
8 changed files with 15 additions and 15 deletions

View File

@@ -1156,7 +1156,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
let mut surface_guard = self.surfaces.data.write();
let hub = A::hub(self);
// this is used for tests, which keep the adapter
hub.clear(&mut *surface_guard, false);
hub.clear(&mut surface_guard, false);
}
pub fn generate_report(&self) -> GlobalReport {
@@ -1205,23 +1205,23 @@ impl<G: GlobalIdentityHandlerFactory> Drop for Global<G> {
// destroy hubs before the instance gets dropped
#[cfg(vulkan)]
{
self.hubs.vulkan.clear(&mut *surface_guard, true);
self.hubs.vulkan.clear(&mut surface_guard, true);
}
#[cfg(metal)]
{
self.hubs.metal.clear(&mut *surface_guard, true);
self.hubs.metal.clear(&mut surface_guard, true);
}
#[cfg(dx12)]
{
self.hubs.dx12.clear(&mut *surface_guard, true);
self.hubs.dx12.clear(&mut surface_guard, true);
}
#[cfg(dx11)]
{
self.hubs.dx11.clear(&mut *surface_guard, true);
self.hubs.dx11.clear(&mut surface_guard, true);
}
#[cfg(gl)]
{
self.hubs.gl.clear(&mut *surface_guard, true);
self.hubs.gl.clear(&mut surface_guard, true);
}
// destroy surfaces

View File

@@ -1231,7 +1231,7 @@ impl crate::Device<super::Api> for super::Device {
Some(inner) => {
let dual = descriptor::upload(
self.raw,
&*inner,
&inner,
&self.shared.heap_views,
&desc.layout.copy_counts,
)?;
@@ -1243,7 +1243,7 @@ impl crate::Device<super::Api> for super::Device {
Some(inner) => {
let dual = descriptor::upload(
self.raw,
&*inner,
&inner,
&self.shared.heap_samplers,
&desc.layout.copy_counts,
)?;

View File

@@ -207,7 +207,7 @@ impl crate::Surface<super::Api> for super::Surface {
let () = msg_send![*render_layer, setFrame: bounds];
}
}
render_layer.set_device(&*device_raw);
render_layer.set_device(&device_raw);
render_layer.set_pixel_format(self.raw_swapchain_format);
render_layer.set_framebuffer_only(framebuffer_only);
render_layer.set_presents_with_transaction(self.present_with_transaction);

View File

@@ -1445,7 +1445,7 @@ impl crate::Device<super::Api> for super::Device {
crate::ShaderInput::SpirV(spv) => Cow::Borrowed(spv),
};
let raw = self.create_shader_module_impl(&*spv)?;
let raw = self.create_shader_module_impl(&spv)?;
if let Some(label) = desc.label {
self.shared

View File

@@ -400,9 +400,9 @@ impl framework::Example for Example {
.slice(pipeline_statistics_offset()..)
.get_mapped_range();
// Convert the raw data into a useful structure
let timestamp_data: &TimestampQueries = bytemuck::from_bytes(&*timestamp_view);
let timestamp_data: &TimestampQueries = bytemuck::from_bytes(&timestamp_view);
let pipeline_stats_data: &PipelineStatisticsQueries =
bytemuck::from_bytes(&*pipeline_stats_view);
bytemuck::from_bytes(&pipeline_stats_view);
// Iterate over the data
for (idx, (timestamp, pipeline)) in timestamp_data
.iter()

View File

@@ -347,7 +347,7 @@ fn shader_input_output_test(
let mapped = mapping_buffer.slice(..).get_mapped_range();
let typed: &[u32] = bytemuck::cast_slice(&*mapped);
let typed: &[u32] = bytemuck::cast_slice(&mapped);
// -- Check results --

View File

@@ -237,7 +237,7 @@ fn capture_rgba_u8_texture(
let slice = output_buffer.slice(..);
slice.map_async(wgpu::MapMode::Read, |_| ());
ctx.device.poll(wgpu::Maintain::Wait);
let data: Vec<u8> = bytemuck::cast_slice(&*slice.get_mapped_range()).to_vec();
let data: Vec<u8> = bytemuck::cast_slice(&slice.get_mapped_range()).to_vec();
// Chunk rows from output buffer, take actual pixel
// bytes from each row and flatten into a vector.
data.chunks_exact(bytes_per_row as usize)

View File

@@ -125,7 +125,7 @@ fn pulling_common(
let slice = buffer.slice(..);
slice.map_async(wgpu::MapMode::Read, |_| ());
ctx.device.poll(wgpu::Maintain::Wait);
let data: Vec<u32> = bytemuck::cast_slice(&*slice.get_mapped_range()).to_vec();
let data: Vec<u32> = bytemuck::cast_slice(&slice.get_mapped_range()).to_vec();
assert_eq!(data, expected);
}