formats icon indicating copy to clipboard operation
formats copied to clipboard

der: error with optional sequence `OCTET STRING` field

Open dishmaker opened this issue 11 months ago • 0 comments

#[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`

dishmaker avatar Mar 24 '25 12:03 dishmaker