Fix `OperationExtensionFuture` poll order (#2247)

* Fix `OperationExtensionFuture` poll order

* Add CHANGELOG.next.toml entry

Co-authored-by: AWS SDK Rust Bot <97246200+aws-sdk-rust-ci@users.noreply.github.com>
This commit is contained in:
Harry Barber 2023-01-25 14:53:20 +00:00 committed by GitHub
parent d301e65efa
commit ebdf59750a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -9,4 +9,10 @@
# message = "Fix typos in module documentation for generated crates"
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
# author = "rcoh"
# author = "rcoh"
[[smithy-rs]]
message = "Fix bug in `OperationExtensionFuture`s `Future::poll` implementation"
references = ["smithy-rs#920"]
meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "server"}
author = "hlbarber"

View File

@ -101,11 +101,11 @@ where
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.project();
let resp = ready!(this.inner.try_poll(cx));
let ext = this
.operation_extension
.take()
.expect("futures cannot be polled after completion");
let resp = ready!(this.inner.try_poll(cx));
Poll::Ready(resp.map(|mut resp| {
resp.extensions_mut().insert(ext);
resp