Skip to content

Commit

Permalink
Mark stream-only fields as such.
Browse files Browse the repository at this point in the history
  • Loading branch information
gendx committed May 6, 2024
1 parent d742ea0 commit 775c10c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/decode/lzbuffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ where
fn append_lz(&mut self, len: usize, dist: usize) -> error::Result<()>;

/// Get a reference to the output sink.
#[cfg(feature = "stream")]
fn get_output(&self) -> &W;

/// Get a mutable reference to the output sink.
#[cfg(feature = "stream")]
fn get_output_mut(&mut self) -> &mut W;

/// Consumes this buffer and flushes any data.
fn finish(self) -> io::Result<W>;

/// Consumes this buffer without flushing any data.
#[cfg(feature = "stream")]
fn into_output(self) -> W;
}

Expand Down Expand Up @@ -139,10 +142,12 @@ where
Ok(())
}

#[cfg(feature = "stream")]
fn get_output(&self) -> &W {
&self.stream
}

#[cfg(feature = "stream")]
fn get_output_mut(&mut self) -> &mut W {
&mut self.stream
}
Expand All @@ -153,6 +158,7 @@ where
Ok(self.stream)
}

#[cfg(feature = "stream")]
fn into_output(self) -> W {
self.stream
}
Expand Down Expand Up @@ -290,10 +296,12 @@ where
Ok(())
}

#[cfg(feature = "stream")]
fn get_output(&self) -> &W {
&self.stream
}

#[cfg(feature = "stream")]
fn get_output_mut(&mut self) -> &mut W {
&mut self.stream
}
Expand All @@ -306,6 +314,7 @@ where
Ok(self.stream)
}

#[cfg(feature = "stream")]
fn into_output(self) -> W {
self.stream
}
Expand Down

0 comments on commit 775c10c

Please sign in to comment.