summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;