Skip to content

Commit 1b63aa9

Browse files
authored
Clean up traits for execute args (#34)
Remove unnecessary Send trait from the command and event_store args, and add the requirement for the Clone trait on command to the Command trait itself. This makes implementation in the client system a bit easier.
1 parent 1bff431 commit 1b63aa9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::event::Event;
33
use crate::event_store::EventStreamId;
44
use std::fmt::Debug;
55

6-
pub trait Command<E: Event> {
6+
pub trait Command<E: Event>: Clone {
77
type State: AggregateState<E>;
88
type Error: std::error::Error + Send + Sync + 'static;
99

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ pub async fn execute<E, C, S>(
2020
) -> Result<(), Error>
2121
where
2222
E: Event,
23-
C: Command<E> + Clone + Send,
24-
S: EventStore + Send,
23+
C: Command<E>,
24+
S: EventStore,
2525
{
2626
let mut retries = 0;
2727
let mut command = command;

0 commit comments

Comments
 (0)