From af67192b450324f6b3792c537c4a6c15c842fbfa Mon Sep 17 00:00:00 2001 From: Rigidity Date: Mon, 16 Sep 2024 13:58:57 -0400 Subject: [PATCH] Implement Deref for Atom --- src/allocator.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/allocator.rs b/src/allocator.rs index 9b31599c..7b258388 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -4,6 +4,7 @@ use crate::reduction::EvalErr; use chia_bls::{G1Element, G2Element}; use std::hash::Hash; use std::hash::Hasher; +use std::ops::Deref; const MAX_NUM_ATOMS: usize = 62500000; const MAX_NUM_PAIRS: usize = 62500000; @@ -130,6 +131,14 @@ impl<'a> AsRef<[u8]> for Atom<'a> { } } +impl<'a> Deref for Atom<'a> { + type Target = [u8]; + + fn deref(&self) -> &Self::Target { + self.as_ref() + } +} + impl<'a> Borrow<[u8]> for Atom<'a> { fn borrow(&self) -> &[u8] { self.as_ref()