summaryrefslogtreecommitdiff
path: root/src/util/buffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/buffer.rs')
-rw-r--r--src/util/buffer.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/util/buffer.rs b/src/util/buffer.rs
index 766b2084..da12b6cb 100644
--- a/src/util/buffer.rs
+++ b/src/util/buffer.rs
@@ -6,7 +6,7 @@ use comemo::Prehashed;
/// A shared buffer that is cheap to clone and hash.
#[derive(Clone, Hash, Eq, PartialEq)]
-pub struct Buffer(Prehashed<Arc<Vec<u8>>>);
+pub struct Buffer(Arc<Prehashed<Vec<u8>>>);
impl Buffer {
/// Return a view into the buffer.
@@ -22,19 +22,13 @@ impl Buffer {
impl From<&[u8]> for Buffer {
fn from(slice: &[u8]) -> Self {
- Self(Prehashed::new(Arc::new(slice.to_vec())))
+ Self(Arc::new(Prehashed::new(slice.to_vec())))
}
}
impl From<Vec<u8>> for Buffer {
fn from(vec: Vec<u8>) -> Self {
- Self(Prehashed::new(Arc::new(vec)))
- }
-}
-
-impl From<Arc<Vec<u8>>> for Buffer {
- fn from(arc: Arc<Vec<u8>>) -> Self {
- Self(Prehashed::new(arc))
+ Self(Arc::new(Prehashed::new(vec)))
}
}