mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-18 06:24:56 +01:00
clippy: Remove unnecessary referencing
This commit is contained in:
@@ -717,7 +717,7 @@ impl Pager {
|
||||
);
|
||||
|
||||
buffer.as_mut_slice()[0..4].copy_from_slice(&page_id.to_be_bytes());
|
||||
buffer.as_mut_slice()[4..4 + page_size].copy_from_slice(&contents_buffer);
|
||||
buffer.as_mut_slice()[4..4 + page_size].copy_from_slice(contents_buffer);
|
||||
|
||||
Arc::new(buffer)
|
||||
};
|
||||
@@ -784,7 +784,7 @@ impl Pager {
|
||||
// Same reason as in open_savepoint, the start offset should always be 0 as we should only have max 1 savepoint
|
||||
// opened at any given time.
|
||||
turso_assert!(start_offset == 0, "start offset should be 0");
|
||||
let c = subjournal.truncate(start_offset as u64)?;
|
||||
let c = subjournal.truncate(start_offset)?;
|
||||
assert!(c.succeeded(), "memory IO should complete immediately");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ impl Subjournal {
|
||||
bytes_read == page_size as i32,
|
||||
"bytes_read should be page_size"
|
||||
);
|
||||
finish_read_page(page.get().id as usize, buffer, page.clone());
|
||||
finish_read_page(page.get().id, buffer, page.clone());
|
||||
},
|
||||
);
|
||||
let c = self.file.pread(offset, c)?;
|
||||
|
||||
@@ -2150,7 +2150,7 @@ pub fn halt(
|
||||
) -> Result<InsnFunctionStepResult> {
|
||||
if err_code > 0 {
|
||||
// Any non-FK constraint violation causes the statement subtransaction to roll back.
|
||||
state.end_statement(&program.connection, &pager, EndStatement::RollbackSavepoint)?;
|
||||
state.end_statement(&program.connection, pager, EndStatement::RollbackSavepoint)?;
|
||||
}
|
||||
match err_code {
|
||||
0 => {}
|
||||
@@ -2187,7 +2187,7 @@ pub fn halt(
|
||||
.load(Ordering::Acquire)
|
||||
> 0
|
||||
{
|
||||
state.end_statement(&program.connection, &pager, EndStatement::RollbackSavepoint)?;
|
||||
state.end_statement(&program.connection, pager, EndStatement::RollbackSavepoint)?;
|
||||
return Err(LimboError::Constraint(
|
||||
"foreign key constraint failed".to_string(),
|
||||
));
|
||||
@@ -2210,14 +2210,14 @@ pub fn halt(
|
||||
));
|
||||
}
|
||||
}
|
||||
state.end_statement(&program.connection, &pager, EndStatement::ReleaseSavepoint)?;
|
||||
state.end_statement(&program.connection, pager, EndStatement::ReleaseSavepoint)?;
|
||||
program
|
||||
.commit_txn(pager.clone(), state, mv_store, false)
|
||||
.map(Into::into)
|
||||
} else {
|
||||
// Even if deferred violations are present, the statement subtransaction completes successfully when
|
||||
// it is part of an interactive transaction.
|
||||
state.end_statement(&program.connection, &pager, EndStatement::ReleaseSavepoint)?;
|
||||
state.end_statement(&program.connection, pager, EndStatement::ReleaseSavepoint)?;
|
||||
Ok(InsnFunctionStepResult::Done)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user