Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion benches/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
I: IntoIterator<Item = M::Symbol>,
{
let mut bitwriter = BitWriter::endian(Vec::new(), BigEndian);
let mut encoder = Encoder::new(model, &mut bitwriter);
let encoder = Encoder::new(model, &mut bitwriter);

encoder.encode_all(input).unwrap();
bitwriter.byte_align().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ where
I: IntoIterator<Item = M::Symbol>,
{
let mut bitwriter = BitWriter::endian(Vec::new(), BigEndian);
let mut encoder = Encoder::new(model, &mut bitwriter);
let encoder = Encoder::new(model, &mut bitwriter);

encoder.encode_all(input).unwrap();
bitwriter.byte_align().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ where
/// This method can fail if the underlying [`BitWrite`] cannot be written
/// to.
pub fn encode_all(
&mut self,
mut self,
symbols: impl IntoIterator<Item = M::Symbol>,
) -> Result<(), Error<M::ValueError>> {
for symbol in symbols {
Expand Down Expand Up @@ -138,7 +138,7 @@ where
///
/// This method can fail if the underlying [`BitWrite`] cannot be written
/// to.
pub fn flush(&mut self) -> io::Result<()> {
pub fn flush(self) -> io::Result<()> {
self.state.flush()
}

Expand Down Expand Up @@ -236,7 +236,7 @@ where
/// # Errors
///
/// This method can fail if the output cannot be written to
pub fn flush(&mut self) -> io::Result<()> {
pub fn flush(mut self) -> io::Result<()> {
self.pending += 1;
if self.state.low <= self.state.quarter() {
self.emit(false)?;
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ where
M: Model,
{
let mut bitwriter = BitWriter::endian(Vec::new(), BigEndian);
let mut encoder = Encoder::new(model, &mut bitwriter);
let encoder = Encoder::new(model, &mut bitwriter);

encoder.encode_all(input).unwrap();
bitwriter.byte_align().unwrap();
Expand Down