Skip to content

Remove unnecessary generics from encode and decode functions #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions src/records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,11 @@ const MAGIC_BYTE_OFFSET: usize = 16;
impl RecordBatchEncoder {
/// Encode records into given buffer, using provided encoding options that select the encoding
/// strategy based on version.
pub fn encode<'a, B, I, CF>(
buf: &mut B,
records: I,
options: &RecordEncodeOptions,
) -> Result<()>
pub fn encode<'a, B, I>(buf: &mut B, records: I, options: &RecordEncodeOptions) -> Result<()>
where
B: ByteBufMut,
I: IntoIterator<Item = &'a Record>,
I::IntoIter: Clone,
CF: Fn(&mut BytesMut, &mut B, Compression) -> Result<()>,
{
Self::encode_with_custom_compression(
buf,
Expand Down Expand Up @@ -507,10 +502,7 @@ impl RecordBatchEncoder {

impl RecordBatchDecoder {
/// Decode the provided buffer into a vec of records.
pub fn decode<B: ByteBuf, F>(buf: &mut B) -> Result<Vec<Record>>
where
F: Fn(&mut bytes::Bytes, Compression) -> Result<B>,
{
pub fn decode<B: ByteBuf>(buf: &mut B) -> Result<Vec<Record>> {
Self::decode_with_custom_compression(
buf,
None::<fn(&mut bytes::Bytes, Compression) -> Result<B>>,
Expand Down