Skip to content

Commit

Permalink
Add Error bound to transaction error types.
Browse files Browse the repository at this point in the history
This was not possible before Rust 1.81.
  • Loading branch information
kpreid committed Sep 5, 2024
1 parent d69efcf commit 9bf9647
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions all-is-cubes/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ pub trait Transaction: Merge {
/// Accordingly, it might not describe the _entire_ set of unmet preconditions,
/// but only one example from it, so as to avoid needing to allocate a
/// data structure of arbitrary size.
///
/// This type should implement [`std::error::Error`] when possible.
type Mismatch: fmt::Debug + fmt::Display + 'static;
type Mismatch: core::error::Error + 'static;

/// Checks whether the target's current state meets the preconditions and returns
/// [`Err`] if it does not.
Expand Down Expand Up @@ -166,9 +164,7 @@ pub trait Merge: Sized {
/// Accordingly, it might not describe the _entire_ area of the conflict
/// but only one example from it, so as to avoid needing to allocate a
/// data structure of arbitrary size.
///
/// This type should implement [`std::error::Error`] when possible.
type Conflict: fmt::Debug + fmt::Display + 'static;
type Conflict: core::error::Error + 'static;

/// Checks whether two transactions can be merged into a single transaction.
/// If so, returns [`Ok`] containing data which may be passed to [`Self::commit_merge()`].
Expand Down

0 comments on commit 9bf9647

Please sign in to comment.