diff options
| author | Mason Reed <mason@vector35.com> | 2025-02-11 14:28:00 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-02-11 14:28:00 -0500 |
| commit | 2b0afb5bb68f84fdc291ade40af31221636d58d9 (patch) | |
| tree | 8b3eefc185e69c3103125e94fe5b17f95853494c /rust/src | |
| parent | 548fddae184d75f9482ab21104d705a31bdf1143 (diff) | |
Add AsMut impl for Ref in Rust API
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/rc.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rust/src/rc.rs b/rust/src/rc.rs index a096d062..56fd4e8c 100644 --- a/rust/src/rc.rs +++ b/rust/src/rc.rs @@ -68,6 +68,12 @@ impl<T: RefCountable> AsRef<T> for Ref<T> { } } +impl<T: RefCountable> AsMut<T> for Ref<T> { + fn as_mut(&mut self) -> &mut T { + &mut self.contents + } +} + impl<T: RefCountable> Deref for Ref<T> { type Target = T; |
