Skip to content

Commit 487e4c3

Browse files
WhatAmISupposedToPutHerejannau
authored andcommitted
rust: alloc: kbox: Add AsRef implementation to Box
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
1 parent dccfbd6 commit 487e4c3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

rust/kernel/alloc/kbox.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,16 @@ where
682682
}
683683
}
684684

685+
impl<T, A> AsRef<T> for Box<T, A>
686+
where
687+
T: ?Sized,
688+
A: Allocator,
689+
{
690+
fn as_ref(&self) -> &T {
691+
self
692+
}
693+
}
694+
685695
/// # Examples
686696
///
687697
/// ```

0 commit comments

Comments
 (0)