| commit | f1c7f3219be65b9afe247401a75ca35ca6dca075 | [log] [tgz] |
|---|---|---|
| author | David Tolnay <dtolnay@gmail.com> | Thu Aug 27 00:46:01 2020 -0700 |
| committer | David Tolnay <dtolnay@gmail.com> | Thu Aug 27 00:58:15 2020 -0700 |
| tree | eb5b422c1421f57d89c734380b4ad09001472c44 | |
| parent | a7ba6a629ced417a20b1ba15d88e37d05409c704 [diff] [blame] |
Handle &mut reference in more places
diff --git a/src/rust_vec.rs b/src/rust_vec.rs index 4c5035d..9ff4bbf 100644 --- a/src/rust_vec.rs +++ b/src/rust_vec.rs
@@ -16,6 +16,10 @@ unsafe { &*(v as *const Vec<T> as *const RustVec<T>) } } + pub fn from_mut(v: &mut Vec<T>) -> &mut Self { + unsafe { &mut *(v as *mut Vec<T> as *mut RustVec<T>) } + } + pub fn into_vec(self) -> Vec<T> { self.repr }