Skip to content

der: error with optional sequence OCTET STRING field #1736

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
dishmaker opened this issue Mar 24, 2025 · 0 comments · Fixed by #1737
Closed

der: error with optional sequence OCTET STRING field #1736

dishmaker opened this issue Mar 24, 2025 · 0 comments · Fixed by #1737

Comments

@dishmaker
Copy link
Contributor

#[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`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant