infer_is_upackage_by_slice in lore-revision/src/infer.rs compares a 3-byte slice against a 4-byte tag, so neither branch can ever match.
if buffer.len() >= 4 {
let package_file_tag = vec![0x9E, 0x2A, 0x83, 0xC1];
if buffer[..3] == package_file_tag {
return true;
}
let package_file_tag_swapped = vec![0xC1, 0x83, 0x2A, 0x9E];
if buffer[..3] == package_file_tag_swapped {
return true;
}
}
Slice equality checks length first, so a 3-element [u8] never equals a 4-element Vec<u8>. The function returns false for every input, in both byte orders. The buffer.len() >= 4 guard right above reads like ..4 was meant.
A test built from a real .uasset header (C1 83 2A 9E) fails on main and passes with ..4 on both lines.
The only caller, infer_is_diffable_by_slice, still treats packages as non-diffable today, because both tag orders start with a byte that is not valid UTF-8 and the check below rejects them anyway. So nothing takes the wrong path today, and the early exit that file/diff.rs describes as the Unreal package check is dead.
infer_is_upackage_by_sliceinlore-revision/src/infer.rscompares a 3-byte slice against a 4-byte tag, so neither branch can ever match.Slice equality checks length first, so a 3-element
[u8]never equals a 4-elementVec<u8>. The function returnsfalsefor every input, in both byte orders. Thebuffer.len() >= 4guard right above reads like..4was meant.A test built from a real
.uassetheader (C1 83 2A 9E) fails on main and passes with..4on both lines.The only caller,
infer_is_diffable_by_slice, still treats packages as non-diffable today, because both tag orders start with a byte that is not valid UTF-8 and the check below rejects them anyway. So nothing takes the wrong path today, and the early exit thatfile/diff.rsdescribes as the Unreal package check is dead.