Skip to content

Commit

Permalink
Remove regex result
Browse files Browse the repository at this point in the history
  • Loading branch information
ruwi-next committed Dec 2, 2024
1 parent de5ba45 commit c59b517
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn iter_log<'a>(
shared_strings: &'a [SharedCacheStrings],
timesync_data: &'a [TimesyncBoot],
exclude_missing: bool,
) -> Result<impl Iterator<Item = (Vec<LogData>, UnifiedLogData)> + 'a, regex::Error> {
) -> impl Iterator<Item = (Vec<LogData>, UnifiedLogData)> + 'a {
LogData::iter_log(
unified_log_data,
strings_data,
Expand Down
16 changes: 7 additions & 9 deletions src/unified_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ impl<'a> LogIterator<'a> {
shared_strings: &'a [SharedCacheStrings],
timesync_data: &'a [TimesyncBoot],
exclude_missing: bool,
) -> Result<Self, regex::Error> {
Ok(LogIterator {
) -> Self {
LogIterator {
unified_log_data,
strings_data,
shared_strings,
timesync_data,
exclude_missing,
catalog_data_iterator_index: 0,
})
}
}
}

Expand Down Expand Up @@ -704,7 +704,7 @@ impl LogData {
shared_strings: &'a [SharedCacheStrings],
timesync_data: &'a [TimesyncBoot],
exclude_missing: bool,
) -> Result<impl Iterator<Item = (Vec<LogData>, UnifiedLogData)> + 'a, regex::Error> {
) -> impl Iterator<Item = (Vec<LogData>, UnifiedLogData)> + 'a {
LogIterator::new(
unified_log_data,
strings_data,
Expand All @@ -731,15 +731,13 @@ impl LogData {
oversize: Vec::new(),
};

let Ok(log_iterator) = LogIterator::new(
let log_iterator = LogIterator::new(
unified_log_data,
strings_data,
shared_strings,
timesync_data,
exclude_missing,
) else {
return (log_data_vec, missing_unified_log_data_vec);
};
);
for (mut log_data, mut missing_unified_log) in log_iterator {
log_data_vec.append(&mut log_data);
missing_unified_log_data_vec
Expand Down Expand Up @@ -942,7 +940,7 @@ mod tests {
let buffer = fs::read(test_path).unwrap();

let (_, results) = LogData::parse_unified_log(&buffer).unwrap();
let iter = iter_log(&results, &[], &[], &[], false).unwrap();
let iter = iter_log(&results, &[], &[], &[], false);
for (entry, remaining) in iter {
assert!(entry.len() > 1000);
assert!(remaining.catalog_data.is_empty());
Expand Down

0 comments on commit c59b517

Please sign in to comment.