mirror of
https://codeberg.org/icewind/vbspview.git
synced 2026-06-03 18:24:09 +02:00
clippy
This commit is contained in:
parent
874266cc38
commit
ba871ebfcc
5 changed files with 12 additions and 14 deletions
|
|
@ -13,7 +13,7 @@ pub fn load_map(data: &[u8], loader: &mut Loader) -> Result<Vec<CpuModel>, Error
|
|||
let props = load_props(loader, bsp.static_props())?;
|
||||
let mut models = Vec::with_capacity(props.len() + 1);
|
||||
models.push(world);
|
||||
models.extend(props.into_iter());
|
||||
models.extend(props);
|
||||
Ok(models)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ impl Loader {
|
|||
}
|
||||
}
|
||||
if let Some(pack) = &self.pack {
|
||||
if let Some(_) = pack.get(name).ok().flatten() {
|
||||
if pack.get(name).ok().flatten().is_some() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ pub fn load_material(
|
|||
.map(|dir| {
|
||||
format!(
|
||||
"materials/{}",
|
||||
dir.to_ascii_lowercase().trim_start_matches("/")
|
||||
dir.to_ascii_lowercase().trim_start_matches('/')
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
|
@ -96,7 +96,7 @@ pub fn load_material(
|
|||
|
||||
let bump_map = material.bump_map().and_then(|path| {
|
||||
Some(TextureData {
|
||||
image: load_texture(&path, loader).ok()?,
|
||||
image: load_texture(path, loader).ok()?,
|
||||
name: path.into(),
|
||||
})
|
||||
});
|
||||
|
|
|
|||
|
|
@ -108,9 +108,7 @@ impl<C: Control> Renderer<C> {
|
|||
.iter()
|
||||
.enumerate()
|
||||
.filter_map(|(i, model)| {
|
||||
if !self.gui.show_bsp && i == 0 {
|
||||
None
|
||||
} else if !self.gui.show_props && i > 0 {
|
||||
if (!self.gui.show_bsp && i == 0) || (!self.gui.show_props && i > 0) {
|
||||
None
|
||||
} else {
|
||||
Some(model)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue