cl-structures: add to_ref
associated function on Interned
type, for non-borrowing conversion
This commit is contained in:
parent
883fd31d38
commit
e5a51ba6c2
@ -35,6 +35,11 @@ pub mod interned {
|
|||||||
pub fn as_ptr(interned: &Self) -> *const T {
|
pub fn as_ptr(interned: &Self) -> *const T {
|
||||||
interned.value
|
interned.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Gets the internal value as a reference with the interner's lifetime
|
||||||
|
pub fn to_ref(interned: &Self) -> &'a T {
|
||||||
|
interned.value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: ?Sized + Debug> Debug for Interned<'_, T> {
|
impl<T: ?Sized + Debug> Debug for Interned<'_, T> {
|
||||||
|
Loading…
Reference in New Issue
Block a user