Skip to main content

expect_segment

Function expect_segment 

Source
pub fn expect_segment<'a>(
    segments: &'a [OwnedSegment],
    cursor: &mut SegmentCursor,
    tag: &str,
) -> Result<&'a OwnedSegment, SegmentNotFound>
Expand description

Consume the segment at cursor if it matches the expected tag. Returns Err if exhausted or tag mismatch.