Skip to content

Commit 2b0afb5

Browse files
committed
Add AsMut impl for Ref in Rust API
1 parent 548fdda commit 2b0afb5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rust/src/rc.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ impl<T: RefCountable> AsRef<T> for Ref<T> {
6868
}
6969
}
7070

71+
impl<T: RefCountable> AsMut<T> for Ref<T> {
72+
fn as_mut(&mut self) -> &mut T {
73+
&mut self.contents
74+
}
75+
}
76+
7177
impl<T: RefCountable> Deref for Ref<T> {
7278
type Target = T;
7379

0 commit comments

Comments
 (0)