Skip to content

Commit eb4d4de

Browse files
andrewjcgfacebook-github-bot
authored andcommitted
Remove lifetime parameter for PortSink (#450)
Summary: Pull Request resolved: #450 With D77868301, we don't need this anymore. Reviewed By: shayne-fletcher, mariusae Differential Revision: D77885759 fbshipit-source-id: acadfe845ad3b31d853c770c3e1e1c6af327e21e
1 parent 41f6283 commit eb4d4de

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

hyperactor/src/mailbox.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -974,27 +974,27 @@ impl MailboxSender for MailboxClient {
974974
}
975975

976976
/// Wrapper to turn `PortRef` into a `Sink`.
977-
pub struct PortSink<'a, C: CanSend, M: RemoteMessage> {
978-
caps: &'a C,
977+
pub struct PortSink<C: CanSend, M: RemoteMessage> {
978+
caps: C,
979979
port: PortRef<M>,
980980
}
981981

982-
impl<'a, C: CanSend, M: RemoteMessage> PortSink<'a, C, M> {
982+
impl<C: CanSend, M: RemoteMessage> PortSink<C, M> {
983983
/// Create new PortSink
984-
pub fn new(caps: &'a C, port: PortRef<M>) -> Self {
984+
pub fn new(caps: C, port: PortRef<M>) -> Self {
985985
Self { caps, port }
986986
}
987987
}
988988

989-
impl<'a, C: CanSend, M: RemoteMessage> Sink<M> for PortSink<'a, C, M> {
989+
impl<C: CanSend, M: RemoteMessage> Sink<M> for PortSink<C, M> {
990990
type Error = MailboxSenderError;
991991

992992
fn poll_ready(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
993993
Poll::Ready(Ok(()))
994994
}
995995

996996
fn start_send(self: Pin<&mut Self>, item: M) -> Result<(), Self::Error> {
997-
self.port.send(self.caps, item)
997+
self.port.send(&self.caps, item)
998998
}
999999

10001000
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {

hyperactor/src/reference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ impl<M: RemoteMessage> PortRef<M> {
896896
}
897897

898898
/// Convert this port into a sink that can be used to send messages using the given capability.
899-
pub fn into_sink<'a, C: cap::CanSend>(self, caps: &'a C) -> PortSink<'a, C, M> {
899+
pub fn into_sink<C: cap::CanSend>(self, caps: C) -> PortSink<C, M> {
900900
PortSink::new(caps, self)
901901
}
902902
}

0 commit comments

Comments
 (0)