Skip to content

Commit

Permalink
Silence false positive significant_drop_in_scrutinee for SplitCase
Browse files Browse the repository at this point in the history
Fixes kube-rs#930

This should ensure that we get a compile error if any temporary is even borrowed
past the `poll_next()` call.
  • Loading branch information
nightkr committed Jun 8, 2022
1 parent 98cf1c8 commit 6cbecbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kube-runtime/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ where
match inner_peek.poll(cx) {
Poll::Ready(Some(x_ref)) => {
if (this.should_consume_item)(x_ref) {
match inner.as_mut().poll_next(cx) {
let item = inner.as_mut().poll_next(cx);
match item {
Poll::Ready(Some(x)) => Poll::Ready(Some((this.try_extract_item_case)(x).expect(
"`try_extract_item_case` returned `None` despite `should_consume_item` returning `true`",
))),
Expand Down

0 comments on commit 6cbecbd

Please sign in to comment.