Skip to content

Commit

Permalink
digest: apply @newpavlov's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Oct 27, 2023
1 parent f93a1d6 commit 6a2190a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions digest/src/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ impl<D: Update + FixedOutputReset + Reset + Clone + 'static> DynDigest for D {
}

fn finalize_into(self, buf: &mut [u8]) -> Result<(), InvalidBufferSize> {
let buf = <&mut Output<Self>>::try_from(buf).map_err(|_| InvalidBufferSize)?;
FixedOutput::finalize_into(self, buf);
Ok(())
buf.try_into()
.map_err(|_| InvalidBufferSize)
.map(|buf| FixedOutput::finalize_into(self, buf))
}

fn finalize_into_reset(&mut self, buf: &mut [u8]) -> Result<(), InvalidBufferSize> {
Expand Down

0 comments on commit 6a2190a

Please sign in to comment.