Skip to content

Commit

Permalink
rename finalize_box to finalize_boxed (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Jun 9, 2020
1 parent 294e992 commit b1d81ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions digest/src/lib.rs
Expand Up @@ -163,7 +163,7 @@ pub trait VariableOutput: core::marker::Sized {
/// they have size of 2 and 3 words respectively.
#[cfg(feature = "alloc")]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
fn finalize_box(self) -> Box<[u8]> {
fn finalize_boxed(self) -> Box<[u8]> {
let n = self.output_size();
let mut buf = vec![0u8; n].into_boxed_slice();
self.finalize_variable(|res| buf.copy_from_slice(res));
Expand All @@ -185,7 +185,7 @@ pub trait XofReader {
/// they have size of 2 and 3 words respectively.
#[cfg(feature = "alloc")]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
fn read_box(&mut self, n: usize) -> Box<[u8]> {
fn read_boxed(&mut self, n: usize) -> Box<[u8]> {
let mut buf = vec![0u8; n].into_boxed_slice();
self.read(&mut buf);
buf
Expand All @@ -206,7 +206,7 @@ pub trait ExtendableOutput: core::marker::Sized {
/// they have size of 2 and 3 words respectively.
#[cfg(feature = "alloc")]
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
fn finalize_box(self, n: usize) -> Box<[u8]> {
fn finalize_boxed(self, n: usize) -> Box<[u8]> {
let mut buf = vec![0u8; n].into_boxed_slice();
self.finalize_xof().read(&mut buf);
buf
Expand Down

0 comments on commit b1d81ba

Please sign in to comment.