Skip to content

Commit

Permalink
Merge pull request #287 from meilisearch/relax-bound-on-lazy
Browse files Browse the repository at this point in the history
relax the HeedDecode bound on Lazy::remap
  • Loading branch information
Kerollmops authored Oct 29, 2024
2 parents 39c77f1 + 9d1f4af commit c2439ef
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 c2439ef

Please sign in to comment.