refactor(gossipsub): remove unnecessary trait bounds (#3317)

Trait bounds on struct declarations should be avoided as much as possible because they creep into every reference of the type. To supply default type parameters, we don't need the trait bounds.
This commit is contained in:
Thomas Eizinger
2023-01-11 20:53:20 +11:00
committed by GitHub
parent cafa37ea21
commit 1b6c915813

View File

@ -211,10 +211,7 @@ impl From<MessageAuthenticity> for PublishConfig {
///
/// The TopicSubscriptionFilter allows applications to implement specific filters on topics to
/// prevent unwanted messages being propagated and evaluated.
pub struct Gossipsub<
D: DataTransform = IdentityTransform,
F: TopicSubscriptionFilter = AllowAllSubscriptionFilter,
> {
pub struct Gossipsub<D = IdentityTransform, F = AllowAllSubscriptionFilter> {
/// Configuration providing gossipsub performance parameters.
config: GossipsubConfig,