Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow clippy::pattern_type_mismatch #4887

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wgpu-core/src/device/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3073,7 +3073,7 @@ impl<A: HalApi> Device<A> {
if validated_stages.contains(wgt::ShaderStages::FRAGMENT) {
for (i, output) in io.iter() {
match color_targets.get(*i as usize) {
Some(&Some(ref state)) => {
Some(Some(state)) => {
validation::check_texture_format(state.format, &output.ty).map_err(
|pipeline| {
pipeline::CreateRenderPipelineError::ColorState(
Expand Down
8 changes: 3 additions & 5 deletions wgpu-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,15 @@
// For some reason `rustc` can warn about these in const generics even
// though they are required.
unused_braces,
// Clashes with clippy::pattern_type_mismatch
clippy::needless_borrowed_reference,
// It gets in the way a lot and does not prevent bugs in practice.
clippy::pattern_type_mismatch,
)]
#![warn(
trivial_casts,
trivial_numeric_casts,
unsafe_op_in_unsafe_fn,
unused_extern_crates,
unused_qualifications,
// We don't match on a reference, unless required.
clippy::pattern_type_mismatch,
unused_qualifications
)]

pub mod any_surface;
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ where
pub(crate) fn label_for_invalid_id(&self, id: I) -> &str {
let (index, _, _) = id.unzip();
match self.map.get(index as usize) {
Some(&Element::Error(_, ref label)) => label,
Some(Element::Error(_, label)) => label,
_ => "",
}
}
Expand Down
4 changes: 2 additions & 2 deletions wgpu-core/src/track/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ impl<I: Copy + Ord, T: Copy + PartialEq> RangedStates<I, T> {
) -> impl Iterator<Item = (Range<I>, &T)> + 'a {
self.ranges
.iter()
.filter(move |&&(ref inner, ..)| inner.end > range.start && inner.start < range.end)
.map(move |&(ref inner, ref v)| {
.filter(move |&(inner, ..)| inner.end > range.start && inner.start < range.end)
.map(move |(inner, v)| {
let new_range = inner.start.max(range.start)..inner.end.min(range.end);

(new_range, v)
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/track/stateless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<Id: TypedId, T: Resource<Id>> StatelessBindGroupSate<Id, T> {
let resources = self.resources.lock();
resources
.iter()
.map(|&(_, ref resource)| resource.clone())
.map(|(_, resource)| resource.clone())
.collect::<Vec<_>>()
.into_iter()
}
Expand Down
Loading