code cleaning

This commit is contained in:
Paul Masurel
2019-02-08 14:54:34 +09:00
parent 91e89714f4
commit f262d4cc22
2 changed files with 3 additions and 3 deletions

View File

@@ -522,7 +522,7 @@ impl IndexWriter {
//
// This will reach an end as the only document_sender
// was dropped with the index_writer.
for _ in document_receiver.clone() {}
for _ in document_receiver.iter() {}
Ok(())
}
@@ -553,7 +553,7 @@ impl IndexWriter {
self.prepare_commit_internal(false)
}
pub(crate) fn prepare_commit_soft(&mut self) -> Result<PreparedCommit> {
pub fn prepare_commit_soft(&mut self) -> Result<PreparedCommit> {
info!("Preparing soft commit");
self.prepare_commit_internal(true)
}

View File

@@ -154,7 +154,7 @@ impl SegmentManager {
// TODO make sure we use `committed_in_the_future` segments,
// when we `commit`, to avoid replaying deletes several times.
} else if let Some(uncommitted_segment) = registers_lock.uncommitted.get(&segment_id) {
} else if registers_lock.uncommitted.get(&segment_id).is_some() {
// This will override our previous entry.
registers_lock.uncommitted.register_segment_entry(segment_entry);
}