Remove unuse code

Rust 1.79 is starting to warn about those. For some reason, the unused
fields weren't caught before.
This commit is contained in:
Hanno Braun 2024-07-08 20:01:15 +02:00
parent d5c175f7fd
commit 8c241298e2
2 changed files with 2 additions and 15 deletions

View File

@ -43,14 +43,11 @@ pub struct Model {
#[derive(Debug)] #[derive(Debug)]
pub struct Material { pub struct Material {
pub name: String,
pub diffuse_texture: super::texture::Texture,
pub bind_group: wgpu::BindGroup, pub bind_group: wgpu::BindGroup,
} }
#[derive(Debug)] #[derive(Debug)]
pub struct Mesh { pub struct Mesh {
pub name: String,
pub vertex_buffer: wgpu::Buffer, pub vertex_buffer: wgpu::Buffer,
pub index_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer,
pub num_elements: u32, pub num_elements: u32,
@ -126,11 +123,7 @@ pub fn load_model(
label: None, label: None,
}); });
materials.push(Material { materials.push(Material { bind_group })
name: m.name,
diffuse_texture,
bind_group,
})
} }
let meshes = models let meshes = models
@ -164,7 +157,6 @@ pub fn load_model(
}); });
Mesh { Mesh {
name: file_name.to_string(),
vertex_buffer, vertex_buffer,
index_buffer, index_buffer,
num_elements: m.mesh.indices.len() as u32, num_elements: m.mesh.indices.len() as u32,

View File

@ -2,7 +2,6 @@ use image::{GenericImageView, ImageError};
#[derive(Debug)] #[derive(Debug)]
pub struct Texture { pub struct Texture {
pub texture: wgpu::Texture,
pub view: wgpu::TextureView, pub view: wgpu::TextureView,
pub sampler: wgpu::Sampler, pub sampler: wgpu::Sampler,
} }
@ -77,10 +76,6 @@ impl Texture {
..Default::default() ..Default::default()
}); });
Self { Self { view, sampler }
texture,
view,
sampler,
}
} }
} }