Skip to content

Commit 2cd08a1

Browse files
authored
Placate Clippy 0.1.63. (#2977)
1 parent f918ac1 commit 2cd08a1

File tree

16 files changed

+32
-31
lines changed

16 files changed

+32
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ the same every time it is rendered, we now warn if it is missing.
8181
- Added downlevel restriction error message for `InvalidFormatUsages` error by @Seamooo in [#2886](https://github.com/gfx-rs/wgpu/pull/2886)
8282
- Add warning when using CompareFunction::*Equal with vertex shader that is missing @invariant tag by @cwfitzgerald in [#2887](https://github.com/gfx-rs/wgpu/pull/2887)
8383
- Update Winit to version 0.27 and raw-window-handle to 0.5 by @wyatt-herkamp in [#2918](https://github.com/gfx-rs/wgpu/pull/2918)
84-
84+
- Address Clippy 0.1.63 complaints. By @jimb in [#2977](https://github.com/gfx-rs/wgpu/pull/2977)
8585
#### Metal
8686
- Extract the generic code into `get_metal_layer` by @jinleili in [#2826](https://github.com/gfx-rs/wgpu/pull/2826)
8787

wgpu-core/src/binding_model.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ impl<A: hal::Api> Resource for PipelineLayout<A> {
648648
}
649649

650650
#[repr(C)]
651-
#[derive(Clone, Debug, Hash, PartialEq)]
651+
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
652652
#[cfg_attr(feature = "trace", derive(Serialize))]
653653
#[cfg_attr(feature = "replay", derive(Deserialize))]
654654
pub struct BufferBinding {
@@ -784,7 +784,7 @@ pub enum GetBindGroupLayoutError {
784784
InvalidGroupIndex(u32),
785785
}
786786

787-
#[derive(Clone, Debug, Error, PartialEq)]
787+
#[derive(Clone, Debug, Error, Eq, PartialEq)]
788788
#[error("Buffer is bound with size {bound_size} where the shader expects {shader_size} in group[{group_index}] compact index {compact_index}")]
789789
pub struct LateMinBufferBindingSizeMismatch {
790790
pub group_index: u32,

wgpu-core/src/command/compute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub struct ComputePassDescriptor<'a> {
136136
pub label: Label<'a>,
137137
}
138138

139-
#[derive(Clone, Debug, Error, PartialEq)]
139+
#[derive(Clone, Debug, Error, Eq, PartialEq)]
140140
pub enum DispatchError {
141141
#[error("compute pipeline must be set")]
142142
MissingPipeline,

wgpu-core/src/command/draw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::num::NonZeroU32;
1414
use thiserror::Error;
1515

1616
/// Error validating a draw call.
17-
#[derive(Clone, Debug, Error, PartialEq)]
17+
#[derive(Clone, Debug, Error, Eq, PartialEq)]
1818
pub enum DrawError {
1919
#[error("blend constant needs to be set")]
2020
MissingBlendConstant,

wgpu-core/src/command/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl<A: HalApi> CommandBuffer<A> {
149149

150150
base.buffers.set_from_tracker(&head.buffers);
151151
base.textures
152-
.set_from_tracker(&*texture_guard, &head.textures);
152+
.set_from_tracker(texture_guard, &head.textures);
153153

154154
Self::drain_barriers(raw, base, buffer_guard, texture_guard);
155155
}
@@ -165,7 +165,7 @@ impl<A: HalApi> CommandBuffer<A> {
165165

166166
base.buffers.set_from_usage_scope(&head.buffers);
167167
base.textures
168-
.set_from_usage_scope(&*texture_guard, &head.textures);
168+
.set_from_usage_scope(texture_guard, &head.textures);
169169

170170
Self::drain_barriers(raw, base, buffer_guard, texture_guard);
171171
}

wgpu-core/src/command/render.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub enum StoreOp {
7171

7272
/// Describes an individual channel within a render pass, such as color, depth, or stencil.
7373
#[repr(C)]
74-
#[derive(Clone, Debug, PartialEq)]
74+
#[derive(Clone, Debug, Eq, PartialEq)]
7575
#[cfg_attr(any(feature = "serial-pass", feature = "trace"), derive(Serialize))]
7676
#[cfg_attr(any(feature = "serial-pass", feature = "replay"), derive(Deserialize))]
7777
pub struct PassChannel<V> {
@@ -737,7 +737,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
737737
let view: &TextureView<A> = cmd_buf
738738
.trackers
739739
.views
740-
.add_single(&*view_guard, at.view)
740+
.add_single(view_guard, at.view)
741741
.ok_or(RenderPassErrorInner::InvalidAttachment(at.view))?;
742742
check_multiview(view)?;
743743
add_view(view, "depth")?;
@@ -853,7 +853,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
853853
let color_view: &TextureView<A> = cmd_buf
854854
.trackers
855855
.views
856-
.add_single(&*view_guard, at.view)
856+
.add_single(view_guard, at.view)
857857
.ok_or(RenderPassErrorInner::InvalidAttachment(at.view))?;
858858
check_multiview(color_view)?;
859859
add_view(color_view, "color")?;
@@ -883,7 +883,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
883883
let resolve_view: &TextureView<A> = cmd_buf
884884
.trackers
885885
.views
886-
.add_single(&*view_guard, resolve_target)
886+
.add_single(view_guard, resolve_target)
887887
.ok_or(RenderPassErrorInner::InvalidAttachment(resolve_target))?;
888888

889889
check_multiview(resolve_view)?;
@@ -1015,7 +1015,7 @@ impl<'a, A: HalApi> RenderPassInfo<'a, A> {
10151015
self.usage_scope
10161016
.textures
10171017
.merge_single(
1018-
&*texture_guard,
1018+
texture_guard,
10191019
ra.texture_id.value,
10201020
Some(ra.selector.clone()),
10211021
&ra.texture_id.ref_count,

wgpu-core/src/device/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const EP_FAILURE: &str = "EP is invalid";
4646
pub type DeviceDescriptor<'a> = wgt::DeviceDescriptor<Label<'a>>;
4747

4848
#[repr(C)]
49-
#[derive(Clone, Copy, Debug, PartialEq)]
49+
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5050
#[cfg_attr(feature = "trace", derive(serde::Serialize))]
5151
#[cfg_attr(feature = "replay", derive(serde::Deserialize))]
5252
pub enum HostMap {

wgpu-core/src/resource.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ impl<A: hal::Api> Borrow<TextureSelector> for Texture<A> {
479479
}
480480

481481
/// Describes a [`TextureView`].
482-
#[derive(Clone, Debug, Default, PartialEq)]
482+
#[derive(Clone, Debug, Default, Eq, PartialEq)]
483483
#[cfg_attr(feature = "trace", derive(serde::Serialize))]
484484
#[cfg_attr(feature = "replay", derive(serde::Deserialize), serde(default))]
485485
pub struct TextureViewDescriptor<'a> {

wgpu-core/src/track/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fn iterate_bitvec_indices(ownership: &BitVec<usize>) -> impl Iterator<Item = usi
238238
})
239239
}
240240

241-
#[derive(Clone, Debug, Error, PartialEq)]
241+
#[derive(Clone, Debug, Error, Eq, PartialEq)]
242242
pub enum UsageConflict {
243243
#[error("Attempted to use buffer {id:?} which is invalid.")]
244244
BufferInvalid { id: id::BufferId },
@@ -291,7 +291,7 @@ impl UsageConflict {
291291
}
292292

293293
/// Pretty print helper that shows helpful descriptions of a conflicting usage.
294-
#[derive(Clone, Debug, PartialEq)]
294+
#[derive(Clone, Debug, Eq, PartialEq)]
295295
pub struct InvalidUse<T> {
296296
current_state: T,
297297
new_state: T,

wgpu-hal/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,23 @@ pub type Label<'a> = Option<&'a str>;
106106
pub type MemoryRange = Range<wgt::BufferAddress>;
107107
pub type FenceValue = u64;
108108

109-
#[derive(Clone, Debug, PartialEq, Error)]
109+
#[derive(Clone, Debug, Eq, PartialEq, Error)]
110110
pub enum DeviceError {
111111
#[error("out of memory")]
112112
OutOfMemory,
113113
#[error("device is lost")]
114114
Lost,
115115
}
116116

117-
#[derive(Clone, Debug, PartialEq, Error)]
117+
#[derive(Clone, Debug, Eq, PartialEq, Error)]
118118
pub enum ShaderError {
119119
#[error("compilation failed: {0:?}")]
120120
Compilation(String),
121121
#[error(transparent)]
122122
Device(#[from] DeviceError),
123123
}
124124

125-
#[derive(Clone, Debug, PartialEq, Error)]
125+
#[derive(Clone, Debug, Eq, PartialEq, Error)]
126126
pub enum PipelineError {
127127
#[error("linkage failed for stage {0:?}: {1}")]
128128
Linkage(wgt::ShaderStages, String),
@@ -132,7 +132,7 @@ pub enum PipelineError {
132132
Device(#[from] DeviceError),
133133
}
134134

135-
#[derive(Clone, Debug, PartialEq, Error)]
135+
#[derive(Clone, Debug, Eq, PartialEq, Error)]
136136
pub enum SurfaceError {
137137
#[error("surface is lost")]
138138
Lost,
@@ -144,7 +144,7 @@ pub enum SurfaceError {
144144
Other(&'static str),
145145
}
146146

147-
#[derive(Clone, Debug, PartialEq, Error)]
147+
#[derive(Clone, Debug, Eq, PartialEq, Error)]
148148
#[error("Not supported")]
149149
pub struct InstanceError;
150150

@@ -1032,7 +1032,7 @@ pub struct RenderPipelineDescriptor<'a, A: Api> {
10321032

10331033
/// Specifies how the alpha channel of the textures should be handled during (martin mouv i step)
10341034
/// compositing.
1035-
#[derive(Debug, Clone, Copy, PartialEq)]
1035+
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
10361036
pub enum CompositeAlphaMode {
10371037
/// The alpha channel, if it exists, of the textures is ignored in the
10381038
/// compositing process. Instead, the textures is treated as if it has a

0 commit comments

Comments
 (0)