diff --git a/core/pseudo.rs b/core/pseudo.rs index 338db2e96..3c43a55ea 100644 --- a/core/pseudo.rs +++ b/core/pseudo.rs @@ -10,14 +10,16 @@ pub struct PseudoCursor { current: RefCell>, } -impl PseudoCursor { - pub fn new() -> Self { +impl Default for PseudoCursor { + fn default() -> Self { Self { record_cursor: RecordCursor::new(), current: RefCell::new(None), } } +} +impl PseudoCursor { pub fn record(&self) -> Ref> { self.current.borrow() } diff --git a/core/vdbe/execute.rs b/core/vdbe/execute.rs index 83263cffc..019c3abd9 100644 --- a/core/vdbe/execute.rs +++ b/core/vdbe/execute.rs @@ -1389,7 +1389,7 @@ pub fn op_open_pseudo( ); { let cursors = &mut state.cursors; - let cursor = PseudoCursor::new(); + let cursor = PseudoCursor::default(); cursors .get_mut(*cursor_id) .unwrap() diff --git a/core/vdbe/sorter.rs b/core/vdbe/sorter.rs index 9af3110e0..ac7e07ed4 100644 --- a/core/vdbe/sorter.rs +++ b/core/vdbe/sorter.rs @@ -280,9 +280,8 @@ impl Sorter { // TODO: blocking will be unnecessary here with IO completions let mut completions = vec![]; for chunk_idx in 0..self.chunks.len() { - match self.push_to_chunk_heap(chunk_idx)? { - Some(c) => completions.push(c), - None => (), + if let Some(c) = self.push_to_chunk_heap(chunk_idx)? { + completions.push(c); }; } self.init_chunk_heap_state = InitChunkHeapState::Start;