From cc3859ed7bed6af2f48ab20b4a762c7fd5af4ead Mon Sep 17 00:00:00 2001 From: Sven Friedrich Date: Tue, 9 Apr 2024 10:06:17 +0200 Subject: [PATCH] refactor: change QueuingPort related generics to `Q` --- src/apex/queuing.rs | 52 ++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/apex/queuing.rs b/src/apex/queuing.rs index b288f47..adaf4ef 100644 --- a/src/apex/queuing.rs +++ b/src/apex/queuing.rs @@ -96,28 +96,28 @@ pub mod abstraction { } } - impl - AsRef> for ConstQueuingPortSender + impl + AsRef> for ConstQueuingPortSender { - fn as_ref(&self) -> &QueuingPortSender { + fn as_ref(&self) -> &QueuingPortSender { &self.0 } } - impl - Borrow> for ConstQueuingPortSender + impl + Borrow> for ConstQueuingPortSender { - fn borrow(&self) -> &QueuingPortSender { + fn borrow(&self) -> &QueuingPortSender { &self.0 } } - impl - TryFrom> for ConstQueuingPortSender + impl + TryFrom> for ConstQueuingPortSender { type Error = Error; - fn try_from(port: QueuingPortSender) -> Result { + fn try_from(port: QueuingPortSender) -> Result { if port.msg_size != MSG_SIZE || port.nb_msgs != NB_MSGS { return Err(Error::InvalidConfig); } @@ -143,28 +143,28 @@ pub mod abstraction { } } - impl - AsRef> for ConstQueuingPortReceiver + impl + AsRef> for ConstQueuingPortReceiver { - fn as_ref(&self) -> &QueuingPortReceiver { + fn as_ref(&self) -> &QueuingPortReceiver { &self.0 } } - impl - Borrow> for ConstQueuingPortReceiver + impl + Borrow> for ConstQueuingPortReceiver { - fn borrow(&self) -> &QueuingPortReceiver { + fn borrow(&self) -> &QueuingPortReceiver { &self.0 } } - impl - TryFrom> for ConstQueuingPortReceiver + impl + TryFrom> for ConstQueuingPortReceiver { type Error = Error; - fn try_from(port: QueuingPortReceiver) -> Result { + fn try_from(port: QueuingPortReceiver) -> Result { if port.msg_size != MSG_SIZE || port.nb_msgs != NB_MSGS { return Err(Error::InvalidConfig); } @@ -181,7 +181,7 @@ pub mod abstraction { nb_msgs: MessageRange, } - impl Clone for QueuingPortSender { + impl Clone for QueuingPortSender { fn clone(&self) -> Self { Self { _b: self._b, @@ -192,10 +192,10 @@ pub mod abstraction { } } - impl - From> for QueuingPortSender + impl + From> for QueuingPortSender { - fn from(port: ConstQueuingPortSender) -> Self { + fn from(port: ConstQueuingPortSender) -> Self { port.0 } } @@ -208,7 +208,7 @@ pub mod abstraction { nb_msgs: MessageRange, } - impl Clone for QueuingPortReceiver { + impl Clone for QueuingPortReceiver { fn clone(&self) -> Self { Self { _b: self._b, @@ -219,10 +219,10 @@ pub mod abstraction { } } - impl - From> for QueuingPortReceiver + impl + From> for QueuingPortReceiver { - fn from(port: ConstQueuingPortReceiver) -> Self { + fn from(port: ConstQueuingPortReceiver) -> Self { port.0 } }