Skip to content

Commit

Permalink
relax the HeedDecode bound on Lazy::remap
Browse files Browse the repository at this point in the history
  • Loading branch information
irevoire committed Oct 28, 2024
1 parent 39c77f1 commit 9d1f4af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion heed-types/src/lazy_decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ pub struct Lazy<'a, C> {
_phantom: marker::PhantomData<C>,
}

impl<'a, C: heed_traits::BytesDecode<'a>> Lazy<'a, C> {
impl<'a, C> Lazy<'a, C> {
/// Change the codec type of the given bytes, specifying the new codec.
pub fn remap<NC>(&self) -> Lazy<'a, NC> {
Lazy { data: self.data, _phantom: marker::PhantomData }
}
}

impl<'a, C: heed_traits::BytesDecode<'a>> Lazy<'a, C> {
/// Decode the given bytes as `DItem`.
pub fn decode(&self) -> Result<C::DItem, BoxedError> {
C::bytes_decode(self.data)
Expand Down

0 comments on commit 9d1f4af

Please sign in to comment.