Clippy; update doc comments to reflect my #[must_use] newtype

This commit is contained in:
Phoebe Goldman
2024-11-07 13:35:48 -05:00
parent 10f0776489
commit d8eb531ccf
4 changed files with 19 additions and 13 deletions
@@ -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.
@@ -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
+10 -7
View File
@@ -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<Option<(TxData, DatastoreComputeDuration)>>;
#[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;
}
+3 -2
View File
@@ -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);