-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hi,
I am using this ASN.1 file:
Test DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
EUTRANTraceID ::= OCTET STRING (SIZE (8))
E-UTRAN-Trace-ID ::= OCTET STRING (SIZE (8))
ENDThis generates the following (invalid) code after running the rasn compiler:
pub mod test {
extern crate alloc;
use core::borrow::Borrow;
use rasn::prelude::*;
use std::sync::LazyLock;
#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[rasn(delegate, identifier = "E-UTRAN-Trace-ID")]
pub struct EUTRANTraceID(pub FixedOctetString<8usize>);
#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[rasn(delegate)]
pub struct EUTRANTraceID(pub FixedOctetString<8usize>);
}the struct EUTranTraceID is defined twice.
Obviously, these names are very similar and "-" characters are not valid for rust structure definitions. So the rasn compiler removes the - characters before defining the struct. However, it may create a conflict with another type when doing this.
I don't have a great fix for this. Maybe if a duplicate type exists, you can add a number to the end?
Metadata
Metadata
Assignees
Labels
No labels