scanner/scanner.rs
1use elyze::scanner::Scanner;
2
3fn process(mut scanner: Scanner<'_, u8>) -> &[u8] {
4 // do something with the data
5 // then bump the scanner
6 scanner.bump_by(3);
7 // return the remaining
8 scanner.remaining()
9}
10
11fn main() {
12 let data = b"hello world";
13 let remaining = process(Scanner::new(data));
14 assert_eq!(remaining, b"lo world");
15}