Skip to content

Commit b61eb87

Browse files
authored
Fix Rust 1.79 lints (#234)
Besides our automerge not caring for a successful CI before merging the latest PR in, this addresses some broken code pointed out by the latest rust 1.79 `clippy`.
1 parent 49d1ace commit b61eb87

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/d3d12/visualizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl AllocatorVisualizer {
144144

145145
if block.sub_allocator.supports_visualization()
146146
&& ui.button("visualize").clicked()
147-
&& !self.selected_blocks.iter().enumerate().any(|(_, x)| {
147+
&& !self.selected_blocks.iter().any(|x| {
148148
x.memory_type_index == mem_type_idx
149149
&& x.block_index == block_idx
150150
})

src/metal/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl<'a> AllocationCreateDesc<'a> {
8787
name: &'a str,
8888
length: u64,
8989
location: MemoryLocation,
90-
) -> AllocationCreateDesc<'a> {
90+
) -> Self {
9191
let size_and_align =
9292
device.heap_buffer_size_and_align(length, memory_location_to_metal(location));
9393
Self {
@@ -98,11 +98,7 @@ impl<'a> AllocationCreateDesc<'a> {
9898
}
9999
}
100100

101-
pub fn texture(
102-
device: &metal::Device,
103-
name: &'a str,
104-
desc: &metal::TextureDescriptor,
105-
) -> AllocationCreateDesc<'a> {
101+
pub fn texture(device: &metal::Device, name: &'a str, desc: &metal::TextureDescriptor) -> Self {
106102
let size_and_align = device.heap_texture_size_and_align(desc);
107103
Self {
108104
name,
@@ -122,7 +118,7 @@ impl<'a> AllocationCreateDesc<'a> {
122118
name: &'a str,
123119
size: u64,
124120
location: MemoryLocation,
125-
) -> AllocationCreateDesc<'a> {
121+
) -> Self {
126122
let size_and_align = device.heap_acceleration_structure_size_and_align_with_size(size);
127123
Self {
128124
name,

src/vulkan/visualizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl AllocatorVisualizer {
121121

122122
if block.sub_allocator.supports_visualization()
123123
&& ui.button("visualize").clicked()
124-
&& !self.selected_blocks.iter().enumerate().any(|(_, x)| {
124+
&& !self.selected_blocks.iter().any(|x| {
125125
x.memory_type_index == mem_type_idx
126126
&& x.block_index == block_idx
127127
})

0 commit comments

Comments
 (0)