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

Removed unneeded trait. #628

Merged
merged 1 commit into from Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/io/ipc/read/reader.rs
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
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()
}
}