Skip to content
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

fix: consume all payload variants #12520

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/payload/basic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ where
if let Some(fut) = Pin::new(&mut this.maybe_better).as_pin_mut() {
if let Poll::Ready(res) = fut.poll(cx) {
this.maybe_better = None;
if let Ok(BuildOutcome::Better { payload, .. }) = res {
if let Ok(Some(payload)) = res.map(|out| out.into_payload())
.inspect_err(|err| warn!(target: "payload_builder", %err, "failed to resolve pending payload"))
{
debug!(target: "payload_builder", "resolving better payload");
return Poll::Ready(Ok(payload))
}
Expand Down Expand Up @@ -767,7 +769,7 @@ impl<Payload> BuildOutcome<Payload> {
/// Consumes the type and returns the payload if the outcome is `Better`.
pub fn into_payload(self) -> Option<Payload> {
match self {
Self::Better { payload, .. } => Some(payload),
Self::Better { payload, .. } | Self::Freeze(payload) => Some(payload),
_ => None,
}
}
Expand Down
Loading