fn ensure_single_asn1_sequence(
        mut parts: Vec<ASN1Block>,
    ) -> Result<Vec<ASN1Block>, KeyDerParsingError> {
        if parts.len() != 1 {
            return Err(Self::parsing_error("Expected exactly one ASN.1 block."));
        }
        if let ASN1Block::Sequence(_offset, part) = parts.remove(0) {
            Ok(part)
        } else {
            Err(Self::parsing_error("Expected an ASN.1 sequence."))
        }
    }
/// Verifies that the specified `parts` contain exactly one ASN1Block, and
/// that this block is an ASN1 Sequence. Returns the contents of that
/// Sequence.
Verifies that the specified `parts` contain exactly one ASN1Block, and
that this block is an ASN1 Sequence. Returns the contents of that
Sequence.
Verifies that the specified ` parts ` contain exactly one ASN1Block and that this block is an ASN1 Sequence . Returns the contents of that Sequence .
fn ensure_single_asn1_sequence(
        mut parts: Vec<ASN1Block>,
    ) -> Result<Vec<ASN1Block>, KeyDerParsingError> {
        if parts.len() != 1 {
            return Err(Self::parsing_error("Expected exactly one ASN.1 block."));
        }
        if let ASN1Block::Sequence(_offset, part) = parts.remove(0) {
            Ok(part)
        } else {
            Err(Self::parsing_error("Expected an ASN.1 sequence."))
        }
    }
fn ensure_single_asn1_sequence ( mut parts : Vec < ASN1Block > , ) -> Result < Vec < ASN1Block > , KeyDerParsingError > { if parts . len ( ) != 1 { return Err ( Self :: parsing_error ( " " ) ) ; } if let ASN1Block :: Sequence ( _offset , part ) = parts . remove ( 0 ) { Ok ( part ) } else { Err ( Self :: parsing_error ( " " ) ) } }
Verifies that the specified `parts` contain exactly one ASN1Block, and
that this block is an ASN1 Sequence.
Verifies that the specified ` parts ` contain exactly one ASN1Block and that this block is an ASN1 Sequence .
parts
Vec<ASN1Block>
parts
Vec<ASN1Block>