Skip to content

der: error with optional sequence OCTET STRING field #1736

@dishmaker

Description

@dishmaker
#[derive(Sequence)]
struct MySequence {
    #[asn1(type = "OCTET STRING", optional = "true")]
    opt_octet_string: Option<&'a [u8]>,
}
   Compiling der v0.8.0-rc.1
error[E0599]: `OctetStringRef<'_>` is not an iterator
   --> der/tests/derive.rs:436:14
    |
436 |     #[derive(Sequence, Default, Eq, PartialEq, Debug)]
    |              ^^^^^^^^ `OctetStringRef<'_>` is not an iterator
    |
   ::: der/src/asn1/octet_string.rs:14:1
    |
14  | pub struct OctetStringRef<'a> {
    | ----------------------------- doesn't satisfy `OctetStringRef<'_>: Iterator`
    |
    = note: the following trait bounds were not satisfied:
            `OctetStringRef<'_>: Iterator`
            which is required by `&mut OctetStringRef<'_>: Iterator`
    = note: this error originates in the derive macro `Sequence`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions