From d8eb531ccfcbcab0e361db140e39244c8997d8cf Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Thu, 7 Nov 2024 13:35:48 -0500 Subject: [PATCH] Clippy; update doc comments to reflect my `#[must_use]` newtype --- .../db/datastore/locking_tx_datastore/mut_tx.rs | 5 +++-- .../src/db/datastore/locking_tx_datastore/tx.rs | 5 +++-- crates/core/src/db/datastore/traits.rs | 17 ++++++++++------- crates/core/src/db/relational_db.rs | 5 +++-- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs b/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs index b53aa39a5..3e9de21b5 100644 --- a/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs +++ b/crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs @@ -1263,8 +1263,9 @@ impl MutTxId { (tx_data, tx) } - /// Returns a [`Duration`] representing the total time spent performing datastore operations - /// during the transaction, for which energy should be charged. + /// Returns a [`DatastoreComputeDuration`] + /// representing the total time spent performing datastore operations during the transaction, + /// for which energy should be charged. pub fn rollback(self) -> DatastoreComputeDuration { // Record metrics for the transaction at the very end, // right before we drop and release the lock. diff --git a/crates/core/src/db/datastore/locking_tx_datastore/tx.rs b/crates/core/src/db/datastore/locking_tx_datastore/tx.rs index 0f0ee4b93..67b97d034 100644 --- a/crates/core/src/db/datastore/locking_tx_datastore/tx.rs +++ b/crates/core/src/db/datastore/locking_tx_datastore/tx.rs @@ -110,8 +110,9 @@ impl TxId { res } - /// Returns a [`Duration`] representing the total time spent performing datastore operations - /// during the transaction, for which energy should be charged. + /// Returns a [`DatastoreComputeDuration`] + /// representing the total time spent performing datastore operations during the transaction, + /// for which energy should be charged. /// /// If this transaction was created by downgrading a [`super::mut_tx::MutTxId`], /// the returned time includes compute time spent in both the original mutable transaction diff --git a/crates/core/src/db/datastore/traits.rs b/crates/core/src/db/datastore/traits.rs index d36c9b6bc..fbb91ff3e 100644 --- a/crates/core/src/db/datastore/traits.rs +++ b/crates/core/src/db/datastore/traits.rs @@ -299,8 +299,9 @@ pub trait Tx { type Tx; fn begin_tx(&self, workload: Workload) -> Self::Tx; - /// Returns a [`Duration`] representing the total time spent performing datastore operations - /// during the transaction, for which energy should be charged. + /// Returns a [`DatastoreComputeduration`] + /// representing the total time spent performing datastore operations during the transaction, + /// for which energy should be charged. fn release_tx(&self, tx: Self::Tx) -> DatastoreComputeDuration; } @@ -311,12 +312,14 @@ pub trait MutTx { /// Returns as two values: /// - A [`TxData`] containing all the mutations performed by the TX, /// which can be used to compute incremental queries. - /// - A [`Duration`] representing the total time spent performing datastore operations - /// during the transaction, for which energy should be charged. + /// - A [`DatastoreComputeduration`] + /// representing the total time spent performing datastore operations during the transaction, + /// for which energy should be charged. fn commit_mut_tx(&self, tx: Self::MutTx) -> Result>; - #[must_use] - /// Returns a [`Duration`] representing the total time spent performing datastore operations - /// during the transaction, for which energy should be charged. + + /// Returns a [`DatastoreComputeDuration`] + /// representing the total time spent performing datastore operations during the transaction, + /// for which energy should be charged. fn rollback_mut_tx(&self, tx: Self::MutTx) -> DatastoreComputeDuration; } diff --git a/crates/core/src/db/relational_db.rs b/crates/core/src/db/relational_db.rs index 2853c1e64..741851f70 100644 --- a/crates/core/src/db/relational_db.rs +++ b/crates/core/src/db/relational_db.rs @@ -618,8 +618,9 @@ impl RelationalDB { } #[tracing::instrument(skip_all)] - /// Returns a [`Duration`] representing the total time spent performing datastore operations - /// during the transaction, for which energy should be charged. + /// Returns a [`DatastoreComputeDuration`] + /// representing the total time spent performing datastore operations during the transaction, + /// for which energy should be charged. pub fn release_tx(&self, tx: Tx) { log::trace!("RELEASE TX"); let compute_duration = self.inner.release_tx(tx);