Coverage Report

Created: 2026-11-11 06:34

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/zopfli-0.8.4/src/iter.rs
Line
Count
Source
1
use core::iter::Peekable;
2
3
pub struct FlagLastIterator<I: Iterator> {
4
    inner: Peekable<I>,
5
}
6
7
impl<I: Iterator> Iterator for FlagLastIterator<I> {
8
    type Item = (I::Item, bool);
9
10
0
    fn next(&mut self) -> Option<Self::Item> {
11
0
        self.inner
12
0
            .next()
13
0
            .map(|val| (val, self.inner.peek().is_none()))
Unexecuted instantiation: <zopfli::iter::FlagLastIterator<core::slice::iter::Chunks<u8>> as core::iter::traits::iterator::Iterator>::next::{closure#0}
Unexecuted instantiation: <zopfli::iter::FlagLastIterator<_> as core::iter::traits::iterator::Iterator>::next::{closure#0}
Unexecuted instantiation: <zopfli::iter::FlagLastIterator<core::slice::iter::Chunks<u8>> as core::iter::traits::iterator::Iterator>::next::{closure#0}
14
0
    }
Unexecuted instantiation: <zopfli::iter::FlagLastIterator<core::slice::iter::Chunks<u8>> as core::iter::traits::iterator::Iterator>::next
Unexecuted instantiation: <zopfli::iter::FlagLastIterator<_> as core::iter::traits::iterator::Iterator>::next
Unexecuted instantiation: <zopfli::iter::FlagLastIterator<core::slice::iter::Chunks<u8>> as core::iter::traits::iterator::Iterator>::next
15
}
16
17
pub trait ToFlagLastIterator: Iterator + Sized {
18
0
    fn flag_last(self) -> FlagLastIterator<Self> {
19
0
        FlagLastIterator {
20
0
            inner: self.peekable(),
21
0
        }
22
0
    }
Unexecuted instantiation: <core::slice::iter::Chunks<u8> as zopfli::iter::ToFlagLastIterator>::flag_last
Unexecuted instantiation: <_ as zopfli::iter::ToFlagLastIterator>::flag_last
Unexecuted instantiation: <core::slice::iter::Chunks<u8> as zopfli::iter::ToFlagLastIterator>::flag_last
23
}
24
25
impl<T: Iterator + Sized> ToFlagLastIterator for T {}