Skip to content

Commit a3be874

Browse files
committed
tweak docs
1 parent 55e4862 commit a3be874

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

block-padding/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ pub trait Padding {
4949
/// Pad message and return padded tail block.
5050
///
5151
/// `Err` is returned only by [`NoPadding`] if `data` length is not multiple of the block size.
52-
/// [`NoPadding`] and [`ZeroPadding`] return `None` instead of the tail block if `data`
52+
/// [`NoPadding`] and [`ZeroPadding`] return `Ok((blocks, None))` if `data` length
5353
/// is multiple of block size. All other padding implementations should always return
54-
/// `Ok(blocks, Some(tail_block))`.
54+
/// `Ok((blocks, Some(tail_block)))`.
5555
#[allow(clippy::type_complexity)]
5656
#[inline]
5757
fn pad_detached<BlockSize: ArraySize>(
5858
data: &[u8],
5959
) -> Result<(&[Array<u8, BlockSize>], Option<Array<u8, BlockSize>>), Error> {
6060
let (blocks, tail) = Array::slice_as_chunks(data);
61-
let mut tail_block = Array::<u8, BlockSize>::default();
61+
let mut tail_block = Array::default();
6262
let pos = tail.len();
6363
tail_block[..pos].copy_from_slice(tail);
6464
Self::pad(&mut tail_block, pos);
@@ -67,7 +67,7 @@ pub trait Padding {
6767

6868
/// Unpad data in `blocks` and return unpadded byte slice.
6969
///
70-
/// Returns error if the block contains malformed padding.
70+
/// Returns error if `blocks` contain malformed padding.
7171
#[inline]
7272
fn unpad_blocks<BlockSize: ArraySize>(blocks: &[Array<u8, BlockSize>]) -> Result<&[u8], Error> {
7373
let bs = BlockSize::USIZE;

0 commit comments

Comments
 (0)