Skip to content

Commit

Permalink
feat(allocator): add AsMut impl for Box (#5515)
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Sep 5, 2024
1 parent 340b535 commit e8bdd12
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/oxc_allocator/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e8bdd12

Please sign in to comment.