diff --git a/crates/sylpheed-cli/src/main.rs b/crates/sylpheed-cli/src/main.rs index 9d35b5e2..877ef2df 100644 --- a/crates/sylpheed-cli/src/main.rs +++ b/crates/sylpheed-cli/src/main.rs @@ -1060,7 +1060,9 @@ fn cmd_mesh_info(file: &Path) -> Result<()> { }; let mut maxedges: Vec = sub .indices - .as_chunks::<3>().0.iter() + .as_chunks::<3>() + .0 + .iter() .map(|t| edge(t[0], t[1]).max(edge(t[1], t[2])).max(edge(t[0], t[2]))) .collect(); maxedges.sort_by(|a, b| a.partial_cmp(b).unwrap()); @@ -1224,7 +1226,9 @@ fn cmd_mesh_render( let med = { let mut e: Vec = sub .indices - .as_chunks::<3>().0.iter() + .as_chunks::<3>() + .0 + .iter() .filter(|t| (t[0] as usize) < n && (t[1] as usize) < n && (t[2] as usize) < n) .map(|t| { let d = |a: u32, b: u32| { @@ -1444,7 +1448,9 @@ fn decode_to_rgba8(tex: &sylpheed_formats::texture::X360Texture) -> Result().0.iter().zip(rgba.as_chunks_mut::<4>().0) { + let src = tex.data.as_chunks::<4>().0; + let dst = rgba.as_chunks_mut::<4>().0; + for (px, out) in src.iter().zip(dst) { out[0] = px[1]; // R out[1] = px[2]; // G out[2] = px[3]; // B diff --git a/crates/sylpheed-formats/src/audio.rs b/crates/sylpheed-formats/src/audio.rs index 74448f2f..ed98b87e 100644 --- a/crates/sylpheed-formats/src/audio.rs +++ b/crates/sylpheed-formats/src/audio.rs @@ -276,11 +276,15 @@ impl GameAudio { let samples: Vec = match (info.codec, bits) { (AudioCodec::Pcm, 8) => data.iter().map(|&b| (b as f32 - 128.0) / 128.0).collect(), (AudioCodec::Pcm, 16) => data - .as_chunks::<2>().0.iter() + .as_chunks::<2>() + .0 + .iter() .map(|c| i16::from_le_bytes([c[0], c[1]]) as f32 / 32768.0) .collect(), (AudioCodec::Pcm, 24) => data - .as_chunks::<3>().0.iter() + .as_chunks::<3>() + .0 + .iter() .map(|c| { let v = ((c[2] as i32) << 16) | ((c[1] as i32) << 8) | c[0] as i32; let v = (v << 8) >> 8; // sign-extend 24→32 @@ -288,7 +292,9 @@ impl GameAudio { }) .collect(), (AudioCodec::PcmFloat, 32) => data - .as_chunks::<4>().0.iter() + .as_chunks::<4>() + .0 + .iter() .map(|c| f32::from_le_bytes([c[0], c[1], c[2], c[3]])) .collect(), _ => return Err(AudioError::UnsupportedPcm { tag: 0, bits }), diff --git a/crates/sylpheed-formats/src/game_data.rs b/crates/sylpheed-formats/src/game_data.rs index c49b2f8c..de613537 100644 --- a/crates/sylpheed-formats/src/game_data.rs +++ b/crates/sylpheed-formats/src/game_data.rs @@ -1131,7 +1131,9 @@ pub fn load_squadrons(pak: &PakArchive) -> Vec { let Some(f) = records.record(id) else { continue }; let slots: Vec<&str> = f.positional.iter().map(|(_, v)| v.as_str()).collect(); let members = slots - .as_chunks::<4>().0.iter() + .as_chunks::<4>() + .0 + .iter() .map(|m| SquadronMember { unit: m[0].to_string(), message_set: text(Some(m[1])), diff --git a/crates/sylpheed-formats/src/ship_capture.rs b/crates/sylpheed-formats/src/ship_capture.rs index e6833493..5dac0ec8 100644 --- a/crates/sylpheed-formats/src/ship_capture.rs +++ b/crates/sylpheed-formats/src/ship_capture.rs @@ -288,12 +288,12 @@ pub fn parse_drawlog(text: &str) -> Vec { let mut consts: Vec<(usize, [f64; 4])> = Vec::new(); let flush = |base: u32, - size: u32, - stride: u32, - pos: &mut Vec<[f32; 3]>, - consts: &[(usize, [f64; 4])], - seen: &mut std::collections::HashSet, - out: &mut Vec| { + size: u32, + stride: u32, + pos: &mut Vec<[f32; 3]>, + consts: &[(usize, [f64; 4])], + seen: &mut std::collections::HashSet, + out: &mut Vec| { let pos = std::mem::take(pos); if base == 0 || stride == 0 || !seen.insert(base) { return; diff --git a/crates/sylpheed-formats/src/vfs.rs b/crates/sylpheed-formats/src/vfs.rs index 85312c5d..cd91c9c6 100644 --- a/crates/sylpheed-formats/src/vfs.rs +++ b/crates/sylpheed-formats/src/vfs.rs @@ -237,7 +237,9 @@ pub fn decode_text(bytes: &[u8]) -> (String, &'static str) { fn decode_utf16(bytes: &[u8], big_endian: bool) -> String { let units: Vec = bytes - .as_chunks::<2>().0.iter() + .as_chunks::<2>() + .0 + .iter() .map(|c| { if big_endian { u16::from_be_bytes([c[0], c[1]])