summaryrefslogtreecommitdiff
path: root/rust/src/rc.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-02-11 14:28:00 -0500
committerMason Reed <mason@vector35.com>2025-02-11 14:28:00 -0500
commit2b0afb5bb68f84fdc291ade40af31221636d58d9 (patch)
tree8b3eefc185e69c3103125e94fe5b17f95853494c /rust/src/rc.rs
parent548fddae184d75f9482ab21104d705a31bdf1143 (diff)
Add AsMut impl for Ref in Rust API
Diffstat (limited to 'rust/src/rc.rs')
-rw-r--r--rust/src/rc.rs6
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;