Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Removed un-needed trait.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Nov 23, 2021
1 parent 439dacf commit e55b450
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
8 changes: 1 addition & 7 deletions src/io/ipc/read/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use arrow_format::ipc::flatbuffers::VerifierOptions;
use crate::array::*;
use crate::datatypes::Schema;
use crate::error::{ArrowError, Result};
use crate::record_batch::{RecordBatch, RecordBatchReader};
use crate::record_batch::RecordBatch;

use super::super::convert;
use super::super::{ARROW_MAGIC, CONTINUATION_MARKER};
Expand Down Expand Up @@ -318,9 +318,3 @@ impl<R: Read + Seek> Iterator for FileReader<R> {
}
}
}

impl<R: Read + Seek> RecordBatchReader for FileReader<R> {
fn schema(&self) -> &Schema {
self.schema().as_ref()
}
}
18 changes: 0 additions & 18 deletions src/record_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,21 +332,3 @@ impl From<RecordBatch> for StructArray {
StructArray::from_data(DataType::Struct(fields), values, None)
}
}

/// Trait for types that can read `RecordBatch`'s.
pub trait RecordBatchReader: Iterator<Item = Result<RecordBatch>> {
/// Returns the schema of this `RecordBatchReader`.
///
/// Implementation of this trait should guarantee that all `RecordBatch`'s returned by this
/// reader should have the same schema as returned from this method.
fn schema(&self) -> &Schema;

/// Reads the next `RecordBatch`.
#[deprecated(
since = "2.0.0",
note = "This method is deprecated in favour of `next` from the trait Iterator."
)]
fn next_batch(&mut self) -> Result<Option<RecordBatch>> {
self.next().transpose()
}
}

0 comments on commit e55b450

Please sign in to comment.