raw events

This commit is contained in:
Robin Appelman 2023-03-16 19:22:10 +01:00
commit 484fd735d1
2 changed files with 9 additions and 5 deletions

View file

@ -58,6 +58,10 @@ pub fn parse(
parse_with_handler::<LogHandler>(log)
}
pub fn raw_events<'a>(log: &'a str) -> impl Iterator<Item = Result<RawEvent<'a>>> + 'a {
LineSplit::new(log).map(RawEvent::parse)
}
pub fn parse_with_handler<Handler: EventHandler>(
log: &str,
) -> Result<
@ -67,7 +71,7 @@ pub fn parse_with_handler<Handler: EventHandler>(
),
Error,
> {
let events = LineSplit::new(log).map(RawEvent::parse);
let events = raw_events(log);
let mut handler = Handler::default();