Skip to content

Conversation

Liyixin95
Copy link

Update planus from 0.3.x to 0.4.x will simplify the conversion from BlockRef to Block.

This is 0.4.x version:

impl<'a> ::core::convert::From<BlockRef<'a>> for Block {
          #[allow(unreachable_code)]
          fn from(value: BlockRef<'a>) -> Self {
              Self {
                  offset: value.offset(),
                  meta_data_length: value.meta_data_length(),
                  body_length: value.body_length(),
              }
          }
      }

This is 0.3.x version:

impl<'a> ::core::convert::TryFrom<BlockRef<'a>> for Block {
                        type Error = ::planus::Error;

                        #[allow(unreachable_code)]
                        fn try_from(value: BlockRef<'a>) -> ::planus::Result<Self> {
                            ::core::result::Result::Ok(Block {
                                offset: value.offset(),
                                meta_data_length: value.meta_data_length(),
                                body_length: value.body_length(),
                            })
                        }
                    }

This will simplify the deserialize_footer function in arrow2 a little bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant