From 97c855293df3c7755e8c8417ec64fc56c9ca4e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=C5=ADhien=20Piatlicki?= Date: Fri, 6 Dec 2024 15:50:11 +0100 Subject: [PATCH] Implement Default for ReplierAdaptor --- nexosim-util/src/combinators.rs | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/nexosim-util/src/combinators.rs b/nexosim-util/src/combinators.rs index b8d6e19..89278e1 100644 --- a/nexosim-util/src/combinators.rs +++ b/nexosim-util/src/combinators.rs @@ -13,11 +13,7 @@ use nexosim::ports::{Output, Requestor}; /// /// Model input is propagated to all the connected replier ports and their /// answers are written to the model output. -pub struct ReplierAdaptor -where - T: Clone + Send + 'static, - R: Clone + Send + 'static, -{ +pub struct ReplierAdaptor { /// Requestor port to be connected to replier port. pub requestor: Requestor, @@ -25,17 +21,10 @@ where pub output: Output, } -impl ReplierAdaptor -where - T: Clone + Send + 'static, - R: Clone + Send + 'static, -{ +impl ReplierAdaptor { /// Creates a `ReplierAdaptor` model. pub fn new() -> Self { - Self { - requestor: Requestor::new(), - output: Output::new(), - } + Self::default() } /// Input port. @@ -46,9 +35,13 @@ where } } -impl Model for ReplierAdaptor -where - T: Clone + Send + 'static, - R: Clone + Send + 'static, -{ +impl Model for ReplierAdaptor {} + +impl Default for ReplierAdaptor { + fn default() -> Self { + Self { + requestor: Requestor::new(), + output: Output::new(), + } + } }