Tony Arcieri

Results 2554 comments of Tony Arcieri

`BitString`/`BitStringRef` could work with `Cow`, but it would probably involve some hacks like using tagged pointers, and storing the owned `BitString` as a tagged pointer. I don't think I can't...

I've changed my mind on `BitString*`: it can't work with `Cow` because we'd need a smart pointer type for a number of bits, which doesn't exist. That said, I don't...

I'm getting a little worried about the `internal_macros` module. It's a lot of macros. Perhaps there are some non-macro-based abstractions to explore there.

Sorry I didn't get to this. Closing as stale, but feel free to reopen.

Closing in favor of #2224, which does make `SequenceRef` into a `repr(transparent)` newtype for `BytesRef`, and adds a public constructor. (Note it doesn't derive `Clone`/`Copy` because you can't do that...

Yeah, we'd need to override `ToOwned`, which would require dropping `Copy`/`Clone` which seems annoying. Part of the problem is those types are owned wrappers around references, where typically types you...

I made `Borrow`/`ToOwned` work for `OctetString`/`OctetStringRef`. It can work for any other types which are newtypes of `String`/`str`. But at this point I think we should probably just defer that...

@RickyDaMa the `BitStringRef` type currently stores the unused bits field separately from the rest of its backing slice: https://github.com/RustCrypto/formats/blob/858f3af9/der/src/asn1/bit_string.rs#L23 This makes it possible to e.g. have constructors which don't require...

That makes the API more awkward for callers though, just to support an `AnyRef` conversion. FWIW here's one usage: https://github.com/RustCrypto/traits/blob/f517eff/elliptic-curve/src/public_key.rs#L486 That would now need a generically-sized intermediate temporary array which...

You can't convert either of those into an `AnyRef` though. It needs the bytes contiguous.