MCPcopy Create free account
hub / github.com/RustCrypto/utils / unwrap

Method unwrap

block-padding/src/lib.rs:404–414  ·  view source on GitHub ↗

Unwrap the `Pad` variant. # Panics If `self` is a variant other than [`PaddedData::Pad`].

(self)

Source from the content-addressed store, hash-verified

402 /// # Panics
403 /// If `self` is a variant other than [`PaddedData::Pad`].
404 pub fn unwrap(self) -> (&'a [Array<u8, BlockSize>], Array<u8, BlockSize>) {
405 match self {
406 PaddedData::Pad { blocks, tail_block } => (blocks, tail_block),
407 PaddedData::NoPad { .. } => {
408 panic!("Expected `PaddedData::Pad`, but got `PaddedData::NoPad`");
409 }
410 PaddedData::Error => {
411 panic!("Expected `PaddedData::Pad`, but got `PaddedData::Error`");
412 }
413 }
414 }
415}

Callers 7

encode_blobsFunction · 0.45
encode_decodeFunction · 0.45
test_vlqFunction · 0.45
digest_pad_combinationsFunction · 0.45
test_eager_serializeFunction · 0.45
test_lazy_serializeFunction · 0.45
test_read_serializeFunction · 0.45

Calls

no outgoing calls

Tested by 6

encode_decodeFunction · 0.36
test_vlqFunction · 0.36
digest_pad_combinationsFunction · 0.36
test_eager_serializeFunction · 0.36
test_lazy_serializeFunction · 0.36
test_read_serializeFunction · 0.36