#1450: cargo fmt for the new mpegts tests and window field

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
vangel76 2026-10-12 23:05:40 +02:00
parent 5198059a7c
commit d034c58edd
1 changed files with 23 additions and 2 deletions

View File

@ -19,7 +19,13 @@ struct Win<'a, S: ByteSource + ?Sized> {
impl<'a, S: ByteSource + ?Sized> Win<'a, S> {
fn new(src: &'a S) -> Self {
Self { src, buf: Vec::new(), start: 0, #[cfg(test)] zero_filled: 0 }
Self {
src,
buf: Vec::new(),
start: 0,
#[cfg(test)]
zero_filled: 0,
}
}
/// The bytes [pos, pos + n) (fewer at the end of the file).
fn get(&mut self, pos: u64, n: usize) -> Result<&[u8]> {
@ -318,7 +324,22 @@ mod tests {
let mut new = Win::new(d.as_slice());
let mut old = OldWin { src: &d, buf: Vec::new(), start: 0, zero_filled: 0 };
let len64 = len as u64;
let mut positions = vec![0, 1, 31, 32, 1 << 19, 1 << 20, (1 << 20) - 1, (1 << 20) + 1, 2 << 20, len64.saturating_sub(40), len64.saturating_sub(1), len64, len64 + 1, len64 + 100];
let mut positions = vec![
0,
1,
31,
32,
1 << 19,
1 << 20,
(1 << 20) - 1,
(1 << 20) + 1,
2 << 20,
len64.saturating_sub(40),
len64.saturating_sub(1),
len64,
len64 + 1,
len64 + 100,
];
positions.extend((0..40).map(|k| len64.saturating_sub(100) + k * 3));
for &pos in &positions {
for n in [0usize, 1, 4, 32, 33, 1000, 65_541, 1 << 20, (1 << 20) + 1, 2 << 20] {