From c032f66f8a6511f5f70de350cffa1284f0c85e6c Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Fri, 14 Apr 2023 15:04:26 -0400 Subject: [PATCH] must_use annotations on DbTxn --- common/db/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/db/src/lib.rs b/common/db/src/lib.rs index e3765b63..7c8bae2b 100644 --- a/common/db/src/lib.rs +++ b/common/db/src/lib.rs @@ -10,6 +10,7 @@ pub trait Get: Send + Sync + Debug { } /// An atomic database operation. +#[must_use] pub trait DbTxn: Send + Sync + Debug + Get { fn put(&mut self, key: impl AsRef<[u8]>, value: impl AsRef<[u8]>); fn del(&mut self, key: impl AsRef<[u8]>); @@ -29,6 +30,7 @@ pub trait Db: 'static + Send + Sync + Clone + Debug + Get { /// An atomic operation for the in-memory databae. #[derive(Debug)] +#[must_use] pub struct MemDbTxn<'a>(&'a MemDb, HashMap, Vec>, HashSet>); impl<'a> Get for MemDbTxn<'a> {