make Completion implementation contain an inner Arc<CompletionInner> so that we can must_use the Completion struct

This commit is contained in:
pedrocarlo
2025-07-28 13:21:53 -03:00
parent 617254116d
commit 7789c569a0
5 changed files with 29 additions and 32 deletions

View File

@@ -695,10 +695,7 @@ impl turso_core::DatabaseStorage for DatabaseFile {
page_idx: usize,
c: turso_core::Completion,
) -> turso_core::Result<Arc<turso_core::Completion>> {
let r = match c.completion_type {
turso_core::CompletionType::Read(ref r) => r,
_ => unreachable!(),
};
let r = c.as_read();
let size = r.buf().len();
assert!(page_idx > 0);
if !(512..=65536).contains(&size) || size & (size - 1) != 0 {