Skip to content

Commit 6a242a8

Browse files
committed
clippy
1 parent f2188da commit 6a242a8

File tree

2 files changed

+71
-247
lines changed

2 files changed

+71
-247
lines changed

src/gltf.rs

+2-40
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl Gltf {
7474
new_node.children = new_node.children.map(|children| {
7575
children
7676
.iter()
77-
.map(|child_index| self.clone_node(child_index.clone(), None, None, None))
77+
.map(|child_index| self.clone_node(*child_index, None, None, None))
7878
.collect()
7979
});
8080
if let Some(position) = position {
@@ -721,7 +721,7 @@ impl Gltf {
721721
.write_all(&color.b.to_le_bytes())
722722
.expect("failed to write colors to buffer");
723723
buffer_vec
724-
.write_all(&(1.0 as f32).to_le_bytes())
724+
.write_all(&1.0_f32.to_le_bytes())
725725
.expect("failed to write colors to buffer");
726726
// buffer_vec
727727
// .write_all(&color.a.to_le_bytes())
@@ -1090,42 +1090,4 @@ impl Gltf {
10901090
self.root.nodes.push(node);
10911091
Some(json::Index::new(self.root.nodes.len() as u32 - 1))
10921092
}
1093-
1094-
pub fn visit_texturing_property(
1095-
&mut self,
1096-
nif: &Nif,
1097-
texturing_property: &NiTexturingProperty,
1098-
) -> Option<String> {
1099-
if !texturing_property.has_base_texture || texturing_property.base_texture.is_none() {
1100-
return None;
1101-
}
1102-
1103-
let diffuse_tex_desc = texturing_property.base_texture.as_ref().unwrap();
1104-
1105-
let diffuse_source = nif
1106-
.blocks
1107-
.get(diffuse_tex_desc.source_ref as usize)
1108-
.expect("invalid property ref");
1109-
1110-
match diffuse_source {
1111-
Block::NiSourceTexture(source_texture) => self.visit_source_texture(source_texture),
1112-
_ => None,
1113-
}
1114-
}
1115-
1116-
pub fn visit_source_texture(&mut self, source_texture: &NiSourceTexture) -> Option<String> {
1117-
if source_texture.use_external == 0 {
1118-
return None;
1119-
}
1120-
1121-
Some(
1122-
source_texture
1123-
.file_name
1124-
.value
1125-
.replace(".tga", ".dds")
1126-
.replace(".TGA", ".dds")
1127-
.replace(".bmp", ".dds")
1128-
.replace(".BMP", ".dds"),
1129-
)
1130-
}
11311093
}

0 commit comments

Comments
 (0)