dishmaker

Results 85 comments of dishmaker

> Why not OctetString/OctetStringRef Why not merge `OctetString` and `OctetStringRef` into something like `Cow` ? With minor CPU overhead an enum would be easier to maintain. Regular OctetString would just...

Ohhh so such `Cow` feature needs a kill switch 😢 ```rust struct BytesRef, #[cfg(not(feature = "alloc"))] pub inner: &'a [u8], } ```

Thanks for responding! > This is an extremely immaturely phrased issue. Ok, I've rephrased the issue. The problem is simple: `NestedReader` should become at most: `NestedReader` and never nest itself...

Another huge problem with nesting is error propagation with offsets. ```rust .at(inner.offset())) ``` Is `.nested()` in a right place? https://github.com/RustCrypto/formats/blob/086ecd7d27aa3f6c5c97dc2a33adc7159008086b/der/src/reader.rs#L59 It should be called in `.read_nested()`, since that's where nesting...

> The input LOC for the entire nested.rs module is 96. It's not a lot of code. It's not many LOC, but `#[derive(Sequence)]` generates a lot of code - impl...

Consider the following structure: ```rust #[derive(Choice)] pub enum Example { ChoiceA(Null), ChoiceB(Vec), /// ... may contain more choices } ``` It won't compile: ``` error[E0275]: overflow evaluating the requirement `SliceReader`...

I've made a refactor of `der` crate. https://github.com/dishmaker/formats/blob/0fd6ddfc1a3000b704eb6fe994de9ef49d3a470d/der/src/reader/nested.rs#L133-L148 ```rust /// Method of NestedDecoder, which no longer implements Reader pub fn read_nested(&mut self, len: Length, f: F) -> Result where F:...

I've just found out that `&mut NestedDecoder` is a double-pointer That's sub-optimal for the CPU that de-references a `&mut R`. A triple pointer would be with current `der v0.7.8`: `&mut...

> I already proposed simply getting rid of NestedReader Well, how would you track the outer nested boundary when entering another nest? Then the `Reader` trait needs to have something...

> Nothing like that is necessary, at least in the public API. It can all be an implementation detail of read_nested. It is necessary, because `read_slice()` and `remaining_len()` relies upon...