add get to the scanner
This commit is contained in:
@@ -27,6 +27,11 @@ impl<'a, S: Scannable + ?Sized> Scanner<'a, S> {
|
|||||||
Self { bin, pat, range, cursor }
|
Self { bin, pat, range, cursor }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get<const LEN: usize>(&mut self) -> Option<[usize;LEN]> {
|
||||||
|
let mut m = [0usize;LEN];
|
||||||
|
self.next(&mut m).then_some(m)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn next(&mut self, saves: &mut [usize]) -> bool {
|
pub fn next(&mut self, saves: &mut [usize]) -> bool {
|
||||||
let mut aob = <[u8; 0x10] as Pod>::uninit();
|
let mut aob = <[u8; 0x10] as Pod>::uninit();
|
||||||
let aob = make_aob(self.pat, &mut aob);
|
let aob = make_aob(self.pat, &mut aob);
|
||||||
|
|||||||
Reference in New Issue
Block a user