feat(allocator): add AsMut impl for Box (#5515)

This commit is contained in:
overlookmotel 2024-09-05 23:52:56 +00:00
parent 340b535715
commit e8bdd12438

View file

@ -70,6 +70,12 @@ impl<'alloc, T: ?Sized> AsRef<T> for Box<'alloc, T> {
}
}
impl<'alloc, T: ?Sized> AsMut<T> for Box<'alloc, T> {
fn as_mut(&mut self) -> &mut T {
self
}
}
impl<'alloc, T: ?Sized + Debug> Debug for Box<'alloc, T> {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
self.deref().fmt(f)