From b3c10809fe4a42669863293af26bc79cf6ffda35 Mon Sep 17 00:00:00 2001 From: Jordan Terrell Date: Thu, 7 Mar 2019 08:15:38 -0600 Subject: [PATCH] Implementing AsRef<[u8]> for DBVector... --- src/db.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/db.rs b/src/db.rs index 9ed4679..d7b26f4 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1769,6 +1769,13 @@ impl Deref for DBVector { } } +impl AsRef<[u8]> for DBVector { + fn as_ref(&self) -> &[u8] { + // Implement this via Deref so as not to repeat ourselves + &*self + } +} + impl Drop for DBVector { fn drop(&mut self) { unsafe {