Skip to content

Commit

Permalink
const-oid: impl AsRef<ObjectIdentifierRef> for ObjectIdentifier
Browse files Browse the repository at this point in the history
`AsRef` is a convenient trait because it's in the prelude
  • Loading branch information
tarcieri committed Jan 5, 2024
1 parent efa381e commit 7a62324
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions const-oid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ impl<const MAX_SIZE: usize> AsRef<[u8]> for ObjectIdentifier<MAX_SIZE> {
}
}

impl<const MAX_SIZE: usize> AsRef<ObjectIdentifierRef> for ObjectIdentifier<MAX_SIZE> {
fn as_ref(&self) -> &ObjectIdentifierRef {
self.as_oid_ref()
}
}

impl<const MAX_SIZE: usize> Borrow<ObjectIdentifierRef> for ObjectIdentifier<MAX_SIZE> {
fn borrow(&self) -> &ObjectIdentifierRef {
self.as_oid_ref()
Expand Down

0 comments on commit 7a62324

Please sign in to comment.