fix: Get rid of some unnecessary trait bounds

Note: It's often tempting to put trait bounds on structs but in most
scenarios the general rule of thumb should be to use trait bounds
in impl blocks but let structs just declare data structures and
not behavior.

For further reading: https://stackoverflow.com/questions/49229332/should-trait-bounds-be-duplicated-in-struct-and-impl
This commit is contained in:
Mårten Blankfors
2024-03-06 10:48:45 +01:00
parent 644cc0d29f
commit fdba3e9694

View File

@@ -93,12 +93,7 @@ pub trait SignerRunLoop<R: Send, CMD: Send> {
}
/// The top-level signer implementation
pub struct Signer<
CMD: Send,
R: Send,
SL: SignerRunLoop<R, CMD> + Send + Sync,
EV: EventReceiver + Send,
> {
pub struct Signer<CMD, R, SL, EV> {
/// the runloop itself
signer_loop: Option<SL>,
/// the event receiver to use
@@ -107,8 +102,6 @@ pub struct Signer<
command_receiver: Option<Receiver<CMD>>,
/// the result sender to use
result_sender: Option<Sender<R>>,
/// marker to permit the R type
_phantom: PhantomData<R>,
}
/// The running signer implementation
@@ -215,7 +208,6 @@ impl<
event_receiver: Some(event_receiver),
command_receiver: Some(command_receiver),
result_sender: Some(result_sender),
_phantom: PhantomData,
}
}