dishmaker

Results 91 comments of dishmaker

Since you've reworked `Utf8StringRef`, it's perfect. I have to play with newest `der` some day, and test `egui` ASN.1 editor to see if ergonomics/performance increased. For minimal support of `x509-cert`...

This partially fixes #1808, because we can rewrite derive(Choice) as: ```rust match tag { String::TAG => {} // ContextSpecificExplicit knows it's constructed, without trickery ContextSpecificExplicit::::TAG => {} // .. more...

So my plan is to make this PR pure generic `*Explicit`. `CustomTagExplicit` Meanwhile, macro code will stay the same and will be eventually deprecated (because of trait flaws).

Naming is hard... choices: - `ClassTaggedExplicit` - `CustomClassExplicit` - `NonUniversalExplicit` - ?

Oh, `SequenceRef` isn't `#[repr(transparent)]` https://github.com/RustCrypto/formats/blob/1985c7f813f6d06e77b668d288651477330e5482/der/src/asn1/octet_string.rs#L14-L17

These types can be `repr(transparent)`. We can remove precomputed length (and ensure it's valid in all constructors). `BytesRef`, `StrRef` as well as `GeneralStringRef`, `OctetStringRef`, ... , `Ia5StringRef`, `Utf8StringRef`, `VideotexStringRef` even...

If we add `DerCow` alongside `borrow::Cow`, we can use `#[cfg(feature = "alloc")]` on the `Owned` variant: ```rust pub enum DerCow + ?Sized, { /// referenced, for example `OctetStringRef` Borrowed(&'a B),...

I think explicit conversion should be preferred here, just like you can't do: ```rust let path: Path = OsStr::new("foo.txt").into() ``` but you can explicitly create `Path::new`: ```rust Path::new(OsStr::new("foo.txt")) ``` which...

We can't implement `From for AnyRef`, because it would need to allocate N+1 bytes for the `unused_bits: u8`.

If `BitStringRef` didn't have `unused_bits: u8` and just `&'a [u8]` with unused_bits on the `[0]` index, then it would be more straightforward - just like `OctetStringRef`.