Skip to content

Commit

Permalink
Using std::iter::once.
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton committed Mar 21, 2021
1 parent 96e5de2 commit eab36b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fastfield/multivalued/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::schema::{Document, Field};
use crate::termdict::TermOrdinal;
use crate::DocId;
use fnv::FnvHashMap;
use std::iter::once;
use std::io;

/// Writer for multi-valued (as in, more than one value per document)
Expand Down Expand Up @@ -133,7 +134,7 @@ impl MultiValuedFastFieldWriter {
.doc_index
.windows(2)
.map(|interval| interval[0] as usize..interval[1] as usize)
.chain(Some(last_interval).into_iter())
.chain(once(last_interval))
{
doc_vals.clear();
let remapped_vals = self.vals[range]
Expand Down

0 comments on commit eab36b5

Please sign in to comment.