Skip to content

Commit

Permalink
Rename methods
Browse files Browse the repository at this point in the history
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
  • Loading branch information
zaharidichev committed Jul 23, 2020
1 parent 8e38db8 commit e64844f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions linkerd/proxy/core/src/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ where
}

pub trait ResolutionStreamExt<E, T>: TryStream<Ok = Update<E>, Error = T> {
fn next_update(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<Update<E>, T>> {
fn poll_next_update(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<Update<E>, T>> {
self.try_poll_next(cx)
.map(|result| result.expect("resolution stream never ends"))
}

fn next_update_pin(&mut self, cx: &mut Context<'_>) -> Poll<Result<Update<E>, T>>
fn poll_next_update_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Result<Update<E>, T>>
where
Self: Unpin,
{
Pin::new(self).next_update(cx)
Pin::new(self).poll_next_update(cx)
}
}

Expand Down
2 changes: 1 addition & 1 deletion linkerd/proxy/discover/src/from_resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ where
return Poll::Ready(Some(Ok(change)));
}

match ready!(this.resolution.next_update(cx))? {
match ready!(this.resolution.poll_next_update(cx))? {
Update::Add(endpoints) => {
for (addr, endpoint) in endpoints.into_iter() {
this.active.insert(addr);
Expand Down
2 changes: 1 addition & 1 deletion linkerd/proxy/resolve/src/map_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ where

fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
let this = self.project();
let update = match ready!(this.resolution.next_update(cx))? {
let update = match ready!(this.resolution.poll_next_update(cx))? {
resolve::Update::Add(eps) => {
let mut update = Vec::new();
for (a, ep) in eps.into_iter() {
Expand Down
4 changes: 2 additions & 2 deletions linkerd/proxy/resolve/src/recover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ where
//
// Attempt recovery/backoff if the resolution fails.

match ready!(resolution.next_update_pin(cx)) {
match ready!(resolution.poll_next_update_unpin(cx)) {
Ok(update) => {
this.update_active(&update);
return Poll::Ready(Some(Ok(update)));
Expand Down Expand Up @@ -301,7 +301,7 @@ where
} => match ready!(resolution
.as_mut()
.expect("illegal state")
.next_update_pin(cx))
.poll_next_update_unpin(cx))
{
Err(e) => State::Recover {
error: Some(e.into()),
Expand Down

0 comments on commit e64844f

Please sign in to comment.