diff options
| author | KyleMiles <krm504@nyu.edu> | 2022-02-14 18:41:40 -0500 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2022-02-14 18:45:16 -0500 |
| commit | 2845ba6208ce3c29998a48df5073ed15a11ead77 (patch) | |
| tree | 7a50af1833dae6d4acaba420f714374fa8421dff /rust/src/rc.rs | |
| parent | 6cd49edb317112acc73f7caeb285f4134a472d72 (diff) | |
Rust: Minor tweaks to 2890; merge architecture::InstructionTextToken and disassembly::InstructionTextToken; update examples
Diffstat (limited to 'rust/src/rc.rs')
| -rw-r--r-- | rust/src/rc.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/src/rc.rs b/rust/src/rc.rs index bc60bf94..a55c46d2 100644 --- a/rust/src/rc.rs +++ b/rust/src/rc.rs @@ -197,6 +197,11 @@ impl<P: CoreOwnedArrayProvider> Array<P> { pub fn len(&self) -> usize { self.count } + + pub fn into_raw_parts(self) -> (*mut P::Raw, usize) { + let me = mem::ManuallyDrop::new(self); + (me.contents, me.count) + } } impl<'a, P: 'a + CoreArrayWrapper<'a> + CoreOwnedArrayProvider> Array<P> { |
