Skip to content

Commit bbeb30a

Browse files
authored
Merge pull request #1745 from katharostech/new-clippy-lints
Fix New Clippy Lints From Rust 1.54.0
2 parents 7c4ab4e + 07cd75a commit bbeb30a

File tree

13 files changed

+93
-99
lines changed

13 files changed

+93
-99
lines changed

wgpu-core/src/device/mod.rs

+20-24
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ impl<A: HalApi> Device<A> {
10001000
) -> Option<id::BindGroupLayoutId> {
10011001
guard
10021002
.iter(self_id.backend())
1003-
.find(|&(_, ref bgl)| bgl.device_id.value.0 == self_id && bgl.entries == *entry_map)
1003+
.find(|&(_, bgl)| bgl.device_id.value.0 == self_id && bgl.entries == *entry_map)
10041004
.map(|(id, value)| {
10051005
value.multi_ref_count.inc();
10061006
id
@@ -1322,9 +1322,9 @@ impl<A: HalApi> Device<A> {
13221322
let res_index = match entry.resource {
13231323
Br::Buffer(ref bb) => {
13241324
let bb = Self::create_buffer_binding(
1325-
&bb,
1325+
bb,
13261326
binding,
1327-
&decl,
1327+
decl,
13281328
&mut used_buffer_ranges,
13291329
&mut dynamic_binding_info,
13301330
&mut used,
@@ -1355,7 +1355,7 @@ impl<A: HalApi> Device<A> {
13551355
let bb = Self::create_buffer_binding(
13561356
bb,
13571357
binding,
1358-
&decl,
1358+
decl,
13591359
&mut used_buffer_ranges,
13601360
&mut dynamic_binding_info,
13611361
&mut used,
@@ -2225,7 +2225,7 @@ impl<A: HalApi> Device<A> {
22252225
if validated_stages.contains(wgt::ShaderStages::FRAGMENT) {
22262226
for (i, state) in color_targets.iter().enumerate() {
22272227
match io.get(&(i as wgt::ShaderLocation)) {
2228-
Some(ref output) => {
2228+
Some(output) => {
22292229
validation::check_texture_format(state.format, &output.ty).map_err(
22302230
|pipeline| {
22312231
pipeline::CreateRenderPipelineError::ColorState(
@@ -3546,16 +3546,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
35463546
Ok(layout) => layout,
35473547
Err(_) => break binding_model::CreateBindGroupError::InvalidLayout,
35483548
};
3549-
let bind_group = match device.create_bind_group(
3550-
device_id,
3551-
bind_group_layout,
3552-
desc,
3553-
&hub,
3554-
&mut token,
3555-
) {
3556-
Ok(bind_group) => bind_group,
3557-
Err(e) => break e,
3558-
};
3549+
let bind_group =
3550+
match device.create_bind_group(device_id, bind_group_layout, desc, hub, &mut token)
3551+
{
3552+
Ok(bind_group) => bind_group,
3553+
Err(e) => break e,
3554+
};
35593555
let ref_count = bind_group.life_guard.add_ref();
35603556

35613557
let id = fid.assign(bind_group, &mut token);
@@ -3808,7 +3804,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
38083804
.unregister(command_encoder_id, &mut token);
38093805
if let Some(cmdbuf) = cmdbuf {
38103806
let device = &mut device_guard[cmdbuf.device_id.value];
3811-
device.untrack::<G>(&hub, &cmdbuf.trackers, &mut token);
3807+
device.untrack::<G>(hub, &cmdbuf.trackers, &mut token);
38123808
}
38133809
}
38143810

@@ -3864,7 +3860,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
38643860
});
38653861
}
38663862

3867-
let render_bundle = match bundle_encoder.finish(desc, device, &hub, &mut token) {
3863+
let render_bundle = match bundle_encoder.finish(desc, device, hub, &mut token) {
38683864
Ok(bundle) => bundle,
38693865
Err(e) => break e,
38703866
};
@@ -4012,7 +4008,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
40124008
let mut token = Token::root();
40134009

40144010
let fid = hub.render_pipelines.prepare(id_in);
4015-
let implicit_context = implicit_pipeline_ids.map(|ipi| ipi.prepare(&hub));
4011+
let implicit_context = implicit_pipeline_ids.map(|ipi| ipi.prepare(hub));
40164012

40174013
let (adapter_guard, mut token) = hub.adapters.read(&mut token);
40184014
let (device_guard, mut token) = hub.devices.read(&mut token);
@@ -4036,7 +4032,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
40364032
adapter,
40374033
desc,
40384034
implicit_context,
4039-
&hub,
4035+
hub,
40404036
&mut token,
40414037
) {
40424038
Ok(pair) => pair,
@@ -4146,7 +4142,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
41464142
let mut token = Token::root();
41474143

41484144
let fid = hub.compute_pipelines.prepare(id_in);
4149-
let implicit_context = implicit_pipeline_ids.map(|ipi| ipi.prepare(&hub));
4145+
let implicit_context = implicit_pipeline_ids.map(|ipi| ipi.prepare(hub));
41504146

41514147
let (device_guard, mut token) = hub.devices.read(&mut token);
41524148
let error = loop {
@@ -4167,7 +4163,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
41674163
device_id,
41684164
desc,
41694165
implicit_context,
4170-
&hub,
4166+
hub,
41714167
&mut token,
41724168
) {
41734169
Ok(pair) => pair,
@@ -4423,7 +4419,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
44234419
let (device_guard, mut token) = hub.devices.read(&mut token);
44244420
let device = device_guard.get(device_id).map_err(|_| InvalidDevice)?;
44254421
device.lock_life(&mut token).triage_suspected(
4426-
&hub,
4422+
hub,
44274423
&device.trackers,
44284424
#[cfg(feature = "trace")]
44294425
None,
@@ -4444,7 +4440,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
44444440
device_guard
44454441
.get(device_id)
44464442
.map_err(|_| DeviceError::Invalid)?
4447-
.maintain(&hub, force_wait, &mut token)?
4443+
.maintain(hub, force_wait, &mut token)?
44484444
};
44494445
fire_map_callbacks(callbacks);
44504446
Ok(())
@@ -4461,7 +4457,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
44614457
let mut token = Token::root();
44624458
let (device_guard, mut token) = hub.devices.read(&mut token);
44634459
for (_, device) in device_guard.iter(A::VARIANT) {
4464-
let cbs = device.maintain(&hub, force_wait, &mut token)?;
4460+
let cbs = device.maintain(hub, force_wait, &mut token)?;
44654461
callbacks.extend(cbs);
44664462
}
44674463
Ok(())

wgpu-core/src/device/queue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
741741

742742
// This will schedule destruction of all resources that are no longer needed
743743
// by the user but used in the command stream, among other things.
744-
let callbacks = match device.maintain(&hub, false, &mut token) {
744+
let callbacks = match device.maintain(hub, false, &mut token) {
745745
Ok(callbacks) => callbacks,
746746
Err(WaitIdleError::Device(err)) => return Err(QueueSubmitError::Queue(err)),
747747
Err(WaitIdleError::StuckGpu) => return Err(QueueSubmitError::StuckGpu),

wgpu-core/src/instance.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
677677
profiling::scope!("create_adapter_from_hal", "Instance");
678678

679679
let mut token = Token::root();
680-
let fid = A::hub(&self).adapters.prepare(input);
680+
let fid = A::hub(self).adapters.prepare(input);
681681

682682
match A::VARIANT {
683683
#[cfg(vulkan)]

0 commit comments

Comments
 (0)