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.
There are some places that take a borrowed array of owned TrustAnchors e.g.,
E.g.,
webpki/src/verify_cert.rs
Line 39 in 34e8f9e
webpki/src/end_entity.rs
Line 106 in 2879b2c
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.