diff --git a/src/db.rs b/src/db.rs index 46c463b..4bd4fc1 100644 --- a/src/db.rs +++ b/src/db.rs @@ -44,6 +44,12 @@ pub enum DataError { UnabortableTransactionError(#[from] UnabortableTransactionError), } +/// This From implementation is necessary to deal with the recursive +/// error type in the error enum. We defined a transaction error, but +/// the only place we use it is when converting from +/// sled::transaction::TransactionError. This converter +/// extracts the inner data error from transaction aborted errors, and +/// forwards anything else onward as-is, but wrapped in DataError. impl From> for DataError { fn from(error: TransactionError) -> Self { match error {