Skip to content

Commit

Permalink
Pleasing clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton committed Dec 2, 2021
1 parent dde49ac commit f378d9a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/indexer/index_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ impl IndexWriter {
// marks the segment updater as killed. From now on, all
// segment updates will be ignored.
self.segment_updater.kill();
let document_receiver = self.operation_receiver();
let document_receiver_res = self.operation_receiver();

// take the directory lock to create a new index_writer.
let directory_lock = self
Expand All @@ -579,7 +579,9 @@ impl IndexWriter {
//
// This will reach an end as the only document_sender
// was dropped with the index_writer.
for _ in document_receiver {}
if let Ok(document_receiver) = document_receiver_res {
for _ in document_receiver {}
}

Ok(self.committed_opstamp)
}
Expand Down
2 changes: 1 addition & 1 deletion src/indexer/index_writer_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl IndexWriterStatus {
.receive_channel
.read()
.expect("This lock should never be poisoned");
rlock.as_ref().map(|receiver| receiver.clone())
rlock.as_ref().cloned()
}

/// Create an index writer bomb.
Expand Down
4 changes: 1 addition & 3 deletions src/store/index/skip_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ impl<'a> Iterator for LayerCursor<'a> {
return None;
}
let (block_mut, remaining_mut) = (&mut self.block, &mut self.remaining);
if block_mut.deserialize(remaining_mut).is_err() {
return None;
}
block_mut.deserialize(remaining_mut).ok()?;
self.cursor = 0;
}
let res = Some(self.block.get(self.cursor));
Expand Down

0 comments on commit f378d9a

Please sign in to comment.