Skip to content

Interoperability improvement: impl AsRef<DecodingKey> for DecodingKey #519

Description

@atezet

It would be useful to implement AsRef<DecodingKey> for DecodingKey. And as a follow up maybe even allow decode to take an impl AsRef<DecodingKey>.

From AsRef#reflexivity:

Ideally, AsRef would be reflexive, i.e. there would be an impl<T: ?Sized> AsRef<T> for T with as_ref simply returning its argument unchanged. Such a blanket implementation is currently not provided due to technical restrictions of Rust’s type system (it would be overlapping with another existing blanket implementation for &T where T: AsRef<U> [...])

Would happily work on a PR, if desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions