Player: compare-dumps's word walk reads each word through a function, not a closure

4027438d7d dropped the closure's copy of each word, and a closure that returns a slice of its
argument does not name that lifetime, so the crate did not compile (m3-max-71456). The word is
now read by a nested function whose signature ties the slice to the bytes.

Verified: clippy and the dump tests in the job named in the lane's report; no local build.
This commit is contained in:
Anees Iqbal committed 2026-11-23 08:53:32 -08:00
1 parent 4027438d7d
commit 7f8df4f044
1 file changed
+5 -2
@@ -274,11 +274,14 @@ pub(super) fn words(a: &[u8], b: &[u8], covered: &[(u64, u64)]) -> (u64, u64, Op
if a == b {
return (differing, under, first);
}
/// The word of `bytes` at byte `at`: none past its end, fewer than 4 bytes at a short end.
fn side(bytes: &[u8], at: usize) -> Option<&[u8]> {
bytes.get(at..(at + 4).min(bytes.len()))
}
let longest = a.len().max(b.len()).div_ceil(4);
for word in 0..longest {
let at = word * 4;
let side = |bytes: &[u8]| bytes.get(at..(at + 4).min(bytes.len()));
if side(a) == side(b) {
if side(a, at) == side(b, at) {
continue;
}
differing += 1;