Skip to content

Commit e85e8b5

Browse files
refactor: resolve clippy::explicit_auto_deref
1 parent a59a8ad commit e85e8b5

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

wgpu-core/src/hub.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
11561156
let mut surface_guard = self.surfaces.data.write();
11571157
let hub = A::hub(self);
11581158
// this is used for tests, which keep the adapter
1159-
hub.clear(&mut *surface_guard, false);
1159+
hub.clear(&mut surface_guard, false);
11601160
}
11611161

11621162
pub fn generate_report(&self) -> GlobalReport {
@@ -1205,23 +1205,23 @@ impl<G: GlobalIdentityHandlerFactory> Drop for Global<G> {
12051205
// destroy hubs before the instance gets dropped
12061206
#[cfg(vulkan)]
12071207
{
1208-
self.hubs.vulkan.clear(&mut *surface_guard, true);
1208+
self.hubs.vulkan.clear(&mut surface_guard, true);
12091209
}
12101210
#[cfg(metal)]
12111211
{
1212-
self.hubs.metal.clear(&mut *surface_guard, true);
1212+
self.hubs.metal.clear(&mut surface_guard, true);
12131213
}
12141214
#[cfg(dx12)]
12151215
{
1216-
self.hubs.dx12.clear(&mut *surface_guard, true);
1216+
self.hubs.dx12.clear(&mut surface_guard, true);
12171217
}
12181218
#[cfg(dx11)]
12191219
{
1220-
self.hubs.dx11.clear(&mut *surface_guard, true);
1220+
self.hubs.dx11.clear(&mut surface_guard, true);
12211221
}
12221222
#[cfg(gl)]
12231223
{
1224-
self.hubs.gl.clear(&mut *surface_guard, true);
1224+
self.hubs.gl.clear(&mut surface_guard, true);
12251225
}
12261226

12271227
// destroy surfaces

wgpu-hal/src/dx12/device.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ impl crate::Device<super::Api> for super::Device {
12311231
Some(inner) => {
12321232
let dual = descriptor::upload(
12331233
self.raw,
1234-
&*inner,
1234+
&inner,
12351235
&self.shared.heap_views,
12361236
&desc.layout.copy_counts,
12371237
)?;
@@ -1243,7 +1243,7 @@ impl crate::Device<super::Api> for super::Device {
12431243
Some(inner) => {
12441244
let dual = descriptor::upload(
12451245
self.raw,
1246-
&*inner,
1246+
&inner,
12471247
&self.shared.heap_samplers,
12481248
&desc.layout.copy_counts,
12491249
)?;

wgpu-hal/src/metal/surface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl crate::Surface<super::Api> for super::Surface {
207207
let () = msg_send![*render_layer, setFrame: bounds];
208208
}
209209
}
210-
render_layer.set_device(&*device_raw);
210+
render_layer.set_device(&device_raw);
211211
render_layer.set_pixel_format(self.raw_swapchain_format);
212212
render_layer.set_framebuffer_only(framebuffer_only);
213213
render_layer.set_presents_with_transaction(self.present_with_transaction);

wgpu-hal/src/vulkan/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ impl crate::Device<super::Api> for super::Device {
14451445
crate::ShaderInput::SpirV(spv) => Cow::Borrowed(spv),
14461446
};
14471447

1448-
let raw = self.create_shader_module_impl(&*spv)?;
1448+
let raw = self.create_shader_module_impl(&spv)?;
14491449

14501450
if let Some(label) = desc.label {
14511451
self.shared

wgpu/examples/mipmap/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,9 @@ impl framework::Example for Example {
400400
.slice(pipeline_statistics_offset()..)
401401
.get_mapped_range();
402402
// Convert the raw data into a useful structure
403-
let timestamp_data: &TimestampQueries = bytemuck::from_bytes(&*timestamp_view);
403+
let timestamp_data: &TimestampQueries = bytemuck::from_bytes(&timestamp_view);
404404
let pipeline_stats_data: &PipelineStatisticsQueries =
405-
bytemuck::from_bytes(&*pipeline_stats_view);
405+
bytemuck::from_bytes(&pipeline_stats_view);
406406
// Iterate over the data
407407
for (idx, (timestamp, pipeline)) in timestamp_data
408408
.iter()

wgpu/tests/shader/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ fn shader_input_output_test(
347347

348348
let mapped = mapping_buffer.slice(..).get_mapped_range();
349349

350-
let typed: &[u32] = bytemuck::cast_slice(&*mapped);
350+
let typed: &[u32] = bytemuck::cast_slice(&mapped);
351351

352352
// -- Check results --
353353

wgpu/tests/shader_primitive_index/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ fn capture_rgba_u8_texture(
237237
let slice = output_buffer.slice(..);
238238
slice.map_async(wgpu::MapMode::Read, |_| ());
239239
ctx.device.poll(wgpu::Maintain::Wait);
240-
let data: Vec<u8> = bytemuck::cast_slice(&*slice.get_mapped_range()).to_vec();
240+
let data: Vec<u8> = bytemuck::cast_slice(&slice.get_mapped_range()).to_vec();
241241
// Chunk rows from output buffer, take actual pixel
242242
// bytes from each row and flatten into a vector.
243243
data.chunks_exact(bytes_per_row as usize)

wgpu/tests/vertex_indices/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn pulling_common(
125125
let slice = buffer.slice(..);
126126
slice.map_async(wgpu::MapMode::Read, |_| ());
127127
ctx.device.poll(wgpu::Maintain::Wait);
128-
let data: Vec<u32> = bytemuck::cast_slice(&*slice.get_mapped_range()).to_vec();
128+
let data: Vec<u32> = bytemuck::cast_slice(&slice.get_mapped_range()).to_vec();
129129

130130
assert_eq!(data, expected);
131131
}

0 commit comments

Comments
 (0)