From 671d266dd662690ebda0d47763cbd04b48ea89ba Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Wed, 22 Oct 2025 11:47:46 +0400 Subject: [PATCH] Revert "wip" This reverts commit dd34f7fd504fbbd57e7802da4e76447c4911ab09. --- core/lib.rs | 1 - core/storage/btree.rs | 12 +++++------- core/vdbe/execute.rs | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/core/lib.rs b/core/lib.rs index 8a057e326..637e91c92 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -15,7 +15,6 @@ mod json; pub mod mvcc; mod parameters; mod pragma; -pub mod primitives; mod pseudo; mod schema; #[cfg(feature = "series")] diff --git a/core/storage/btree.rs b/core/storage/btree.rs index 38a4511b7..3124050cd 100644 --- a/core/storage/btree.rs +++ b/core/storage/btree.rs @@ -41,7 +41,7 @@ use super::{ }; use std::{ any::Any, - cell::Cell, + cell::{Cell, Ref, RefCell}, cmp::{Ordering, Reverse}, collections::{BinaryHeap, HashMap}, fmt::Debug, @@ -50,8 +50,6 @@ use std::{ sync::Arc, }; -use crate::primitives::{Ref, RefCell, RefMut}; - /// The B-Tree page header is 12 bytes for interior pages and 8 bytes for leaf pages. /// /// +--------+-----------------+-----------------+-----------------+--------+----- ..... ----+ @@ -554,7 +552,7 @@ pub trait CursorTrait: Any { // --- start: BTreeCursor specific functions ---- fn invalidate_record(&mut self); fn has_rowid(&self) -> bool; - fn record_cursor_mut(&self) -> RefMut<'_, RecordCursor>; + fn record_cursor_mut(&self) -> std::cell::RefMut<'_, RecordCursor>; fn get_pager(&self) -> Arc; fn get_skip_advance(&self) -> bool; // --- end: BTreeCursor specific functions ---- @@ -4795,7 +4793,7 @@ impl BTreeCursor { Ok(IOResult::Done(())) } - fn get_immutable_record_or_create(&self) -> RefMut<'_, Option> { + fn get_immutable_record_or_create(&self) -> std::cell::RefMut<'_, Option> { let mut reusable_immutable_record = self.reusable_immutable_record.borrow_mut(); if reusable_immutable_record.is_none() { let page_size = self.pager.get_page_size_unchecked().get(); @@ -4805,7 +4803,7 @@ impl BTreeCursor { reusable_immutable_record } - fn get_immutable_record(&self) -> RefMut<'_, Option> { + fn get_immutable_record(&self) -> std::cell::RefMut<'_, Option> { self.reusable_immutable_record.borrow_mut() } @@ -5613,7 +5611,7 @@ impl CursorTrait for BTreeCursor { .invalidate(); self.record_cursor.borrow_mut().invalidate(); } - fn record_cursor_mut(&self) -> RefMut<'_, RecordCursor> { + fn record_cursor_mut(&self) -> std::cell::RefMut<'_, RecordCursor> { self.record_cursor.borrow_mut() } diff --git a/core/vdbe/execute.rs b/core/vdbe/execute.rs index fa42f8a4e..dadc7a063 100644 --- a/core/vdbe/execute.rs +++ b/core/vdbe/execute.rs @@ -112,7 +112,7 @@ macro_rules! load_insn { }; #[cfg(not(debug_assertions))] let Insn::$variant { $($field $(: $binding)?),*} = $insn else { - // this will optimize away the branch + // this will optimize away the branch unsafe { std::hint::unreachable_unchecked() }; }; };