Skip to content

Commit

Permalink
Remove useless into_iter
Browse files Browse the repository at this point in the history
  • Loading branch information
xianwill committed Jun 11, 2021
1 parent 0b22619 commit e6a0fc4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rust/src/checkpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl CheckPointWriter {
.current_metadata()
.ok_or(CheckPointWriterError::MissingMetaData)?;

let jsons = std::iter::once(action::Action::protocol(action::Protocol {
let mut jsons = std::iter::once(action::Action::protocol(action::Protocol {
min_reader_version: state.min_reader_version(),
min_writer_version: state.min_writer_version(),
}))
Expand Down Expand Up @@ -187,8 +187,7 @@ impl CheckPointWriter {
+ state.files().len()
+ 2;
let decoder = Decoder::new(arrow_schema, batch_size, None);
let mut value_iter = jsons.into_iter();
while let Some(batch) = decoder.next_batch(&mut value_iter)? {
while let Some(batch) = decoder.next_batch(&mut jsons)? {
writer.write(&batch)?;
}
let _ = writer.close()?;
Expand Down

0 comments on commit e6a0fc4

Please sign in to comment.