mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-28 16:48:13 -05:00
feat(storage): make Database::view accept FnOnce instead of FnMut (#1331)
This commit is contained in:
@@ -26,9 +26,9 @@ pub trait Database: for<'a> DatabaseGAT<'a> {
|
||||
|
||||
/// Takes a function and passes a read-only transaction into it, making sure it's closed in the
|
||||
/// end of the execution.
|
||||
fn view<T, F>(&self, mut f: F) -> Result<T, Error>
|
||||
fn view<T, F>(&self, f: F) -> Result<T, Error>
|
||||
where
|
||||
F: FnMut(&<Self as DatabaseGAT<'_>>::TX) -> T,
|
||||
F: FnOnce(&<Self as DatabaseGAT<'_>>::TX) -> T,
|
||||
{
|
||||
let tx = self.tx()?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user