Skip to content

Wrap TrustAnchor array items in AsRef<T> #505

Description

@b-stime

There are some places that take a borrowed array of owned TrustAnchors e.g.,

E.g.,

pub(crate) trust_anchors: &'p [TrustAnchor<'p>],

trust_anchors: &'p [TrustAnchor<'_>],

I believe the array sub-type can be wrapped in AsRef in many of these cases e.g.,
trust_anchors: &'p [AsRef<TrustAnchor<'_>>],

In some of the uses, the implementation doesn't seem to actually need ownership of the TrustAnchor and just reads from it a bit. Optionally accepting a borrowed reference should be helpful for cases e.g., where one or more of the TrustAnchors are cached and re-used.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions