-
Notifications
You must be signed in to change notification settings - Fork 392
chore(provider
): use WeakClient
in GetSubscription
#2219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice,
some nits
provider
): apply GetSubscription
to traitprovider
): use WeakClient
in GetSubscription
|
||
fn into_future(self) -> Self::IntoFuture { | ||
Box::pin(async move { | ||
let pubsub = self.root.pubsub_frontend()?; | ||
let client = | ||
self.client.upgrade().ok_or(TransportErrorKind::custom_str("client dropped"))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok_or_else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't ok_or cleaner?
Regarless, it's a nit 5a8d29f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a quick followup with the changes in #2220
Motivation
The
GetSubscription
future type was introduced in #2203Remove it's reliance on
N: Network
by usingWeakClient
Solution
N: Network
generic fromGetSubscription
by usingWeakClient
PR Checklist