Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

der: introduce OwnedtoRef/RefToOwned traits #797

Merged
merged 13 commits into from
Dec 17, 2022

Conversation

baloo
Copy link
Member

@baloo baloo commented Dec 15, 2022

This introduces the two new traits to go from a ref object to an owned object as discussed in #796

closes #796

der/src/asn1/any.rs Outdated Show resolved Hide resolved
@baloo
Copy link
Member Author

baloo commented Dec 15, 2022

Guess I'll need to gate those to v1.65 since I'm making use of GAT (didn't even realize that)

@tarcieri
Copy link
Member

MSRV bump to 1.65 seems aggressive but probably fine as 1.66 will be out momentarily and it will still be several months before these crates are released

@baloo
Copy link
Member Author

baloo commented Dec 15, 2022

I think I like the rustversion macro (https://github.com/dtolnay/rustversion) a lot for that.
The OwnerToRef is gated for >=1.65 but we retain the 1.60 MSRV just without the trait.

@baloo
Copy link
Member Author

baloo commented Dec 15, 2022

I like the situation though:
https://github.com/RustCrypto/formats/actions/runs/3701100883/jobs/6270113493#step:4:92

The syntax moved from (1.60)

    type Borrowed<'a>
        where
        T: 'a,
    = Option<T::Borrowed<'a>>;

to (at least 1.65)

type Borrowed<'a> = Option<T::Borrowed<'a>> where T: 'a;

and it's now a warning.

@baloo baloo force-pushed the baloo/owned-api/ref-to-owned branch from 3c3d3a6 to ae22f5f Compare December 15, 2022 04:56
@tarcieri
Copy link
Member

I’m fine with bumping the MSRV outright. I’d prefer to avoid additional complexity just to preserve an arbitrary MSRV.

@tarcieri
Copy link
Member

@baloo can you rebase?

@baloo baloo force-pushed the baloo/owned-api/ref-to-owned branch from efe08f5 to 8334d10 Compare December 17, 2022 20:56
@tarcieri tarcieri merged commit 3389f86 into RustCrypto:master Dec 17, 2022
@tarcieri
Copy link
Member

D'oh, got the MSRV wrong in the commit message. Mea culpa.

@baloo baloo deleted the baloo/owned-api/ref-to-owned branch December 18, 2022 03:18
@tarcieri tarcieri mentioned this pull request Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants