Skip to content

Commit

Permalink
Do not expect a Some(_)
Browse files Browse the repository at this point in the history
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
  • Loading branch information
zaharidichev committed Aug 7, 2020
1 parent e9d7dcc commit 4b049f0
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions linkerd/proxy/discover/src/make_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,17 @@ where
// services. Don't process any updates until we can do so.
ready!(this.make_endpoint.poll_ready(cx)).map_err(Into::into)?;

match ready!(this.discover.poll_discover(cx))
.expect("XXX(eliza): can this ever be none???")
.map_err(Into::into)?
{
Change::Insert(key, target) => {
// Start building the service and continue. If a pending
// service exists for this addr, it will be canceled.
let fut = this.make_endpoint.call(target);
this.make_futures.push(key, fut);
}
Change::Remove(key) => {
this.pending_removals.push(key);
if let Some(change) = ready!(this.discover.poll_discover(cx)) {
match change.map_err(Into::into)? {
Change::Insert(key, target) => {
// Start building the service and continue. If a pending
// service exists for this addr, it will be canceled.
let fut = this.make_endpoint.call(target);
this.make_futures.push(key, fut);
}
Change::Remove(key) => {
this.pending_removals.push(key);
}
}
}
}
Expand Down

0 comments on commit 4b049f0

Please sign in to comment.