From 3b732ad0db0e44391aa87f7375678fd7a6e43703 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Tue, 14 Feb 2023 14:31:58 +0800 Subject: [PATCH] feat(storage): make `Database::view` accept `FnOnce` instead of `FnMut` (#1331) --- crates/storage/db/src/abstraction/database.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/storage/db/src/abstraction/database.rs b/crates/storage/db/src/abstraction/database.rs index 4de1f4c540..10b6d652e5 100644 --- a/crates/storage/db/src/abstraction/database.rs +++ b/crates/storage/db/src/abstraction/database.rs @@ -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(&self, mut f: F) -> Result + fn view(&self, f: F) -> Result where - F: FnMut(&>::TX) -> T, + F: FnOnce(&>::TX) -> T, { let tx = self.tx()?;