From 2b15a2b24b69e105ebdbb5e8a859e2df75e441c1 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Fri, 11 Oct 2024 20:48:57 -0400 Subject: [PATCH] refactor: fully qual. `size_of` usage (#6401) --- examples/src/bunnymark/mod.rs | 8 ++++---- examples/src/srgb_blend/mod.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/src/bunnymark/mod.rs b/examples/src/bunnymark/mod.rs index 0c242c713..8e71a624d 100644 --- a/examples/src/bunnymark/mod.rs +++ b/examples/src/bunnymark/mod.rs @@ -1,6 +1,6 @@ use bytemuck::{Pod, Zeroable}; use nanorand::{Rng, WyRand}; -use std::{borrow::Cow, mem}; +use std::{borrow::Cow, mem::size_of}; use wgpu::util::DeviceExt; use winit::{ event::{ElementState, KeyEvent}, @@ -164,7 +164,7 @@ impl crate::framework::Example for Example { ty: wgpu::BindingType::Buffer { ty: wgpu::BufferBindingType::Uniform, has_dynamic_offset: false, - min_binding_size: wgpu::BufferSize::new(mem::size_of::() as _), + min_binding_size: wgpu::BufferSize::new(size_of::() as _), }, count: None, }, @@ -195,7 +195,7 @@ impl crate::framework::Example for Example { ty: wgpu::BindingType::Buffer { ty: wgpu::BufferBindingType::Uniform, has_dynamic_offset: true, - min_binding_size: wgpu::BufferSize::new(mem::size_of::() as _), + min_binding_size: wgpu::BufferSize::new(size_of::() as _), }, count: None, }], @@ -337,7 +337,7 @@ impl crate::framework::Example for Example { resource: wgpu::BindingResource::Buffer(wgpu::BufferBinding { buffer: &local_buffer, offset: 0, - size: wgpu::BufferSize::new(mem::size_of::() as _), + size: wgpu::BufferSize::new(size_of::() as _), }), }], label: None, diff --git a/examples/src/srgb_blend/mod.rs b/examples/src/srgb_blend/mod.rs index 198483d54..12476331c 100644 --- a/examples/src/srgb_blend/mod.rs +++ b/examples/src/srgb_blend/mod.rs @@ -1,5 +1,5 @@ use bytemuck::{Pod, Zeroable}; -use std::mem; +use std::mem::size_of; use wgpu::util::DeviceExt; #[repr(C)] @@ -70,7 +70,7 @@ impl crate::framework::Example for Example { _queue: &wgpu::Queue, ) -> Self { // Create the vertex and index buffers - let vertex_size = mem::size_of::(); + let vertex_size = size_of::(); let (vertex_data, index_data) = create_vertices(); let vertex_buf = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {