From e8bdd12438de6f848e0e46b4d8c565fdf573cf04 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:52:56 +0000 Subject: [PATCH] feat(allocator): add `AsMut` impl for `Box` (#5515) --- crates/oxc_allocator/src/boxed.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/oxc_allocator/src/boxed.rs b/crates/oxc_allocator/src/boxed.rs index a334d5cc1d9ac..bb2f9fd538ce3 100644 --- a/crates/oxc_allocator/src/boxed.rs +++ b/crates/oxc_allocator/src/boxed.rs @@ -70,6 +70,12 @@ impl<'alloc, T: ?Sized> AsRef for Box<'alloc, T> { } } +impl<'alloc, T: ?Sized> AsMut 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)