Skip to content

Commit

Permalink
File format via rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nandolawson committed Oct 5, 2024
1 parent d417642 commit 5a575c2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/write/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ impl<'e, E: Engine, W: io::Write> EncoderWriter<'e, E, W> {
pub fn finish(&mut self) -> Result<W> {
// If we could consume self in finish(), we wouldn't have to worry about this case, but
// finish() is retryable in the face of I/O errors, so we can't consume here.
assert!(self.delegate.is_some(), "Encoder has already had finish() called");
assert!(
self.delegate.is_some(),
"Encoder has already had finish() called"
);

self.write_final_leftovers()?;

Expand Down Expand Up @@ -261,7 +264,10 @@ impl<'e, E: Engine, W: io::Write> io::Write for EncoderWriter<'e, E, W> {
///
/// Any errors emitted by the delegate writer are returned.
fn write(&mut self, input: &[u8]) -> Result<usize> {
assert!(self.delegate.is_some(), "Cannot write more after calling finish()");
assert!(
self.delegate.is_some(),
"Cannot write more after calling finish()"
);

if input.is_empty() {
return Ok(0);
Expand Down

0 comments on commit 5a575c2

Please sign in to comment.