Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qlog: Add explicit lifetime parameter to QlogSeqReader #1862

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions qlog/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ pub enum Event {
/// trait.
///
/// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html
pub struct QlogSeqReader {
pub struct QlogSeqReader<'a> {
pub qlog: QlogSeq,
reader: Box<dyn std::io::BufRead + Send + Sync>,
reader: Box<dyn std::io::BufRead + Send + Sync + 'a>,
}

impl QlogSeqReader {
impl<'a> QlogSeqReader<'a> {
pub fn new(
mut reader: Box<dyn std::io::BufRead + Send + Sync>,
mut reader: Box<dyn std::io::BufRead + Send + Sync + 'a>,
) -> Result<Self, Box<dyn std::error::Error>> {
// "null record" skip it
Self::read_record(reader.as_mut());
Expand Down Expand Up @@ -83,7 +83,7 @@ impl QlogSeqReader {
}
}

impl Iterator for QlogSeqReader {
impl<'a> Iterator for QlogSeqReader<'a> {
type Item = Event;

#[inline]
Expand Down