-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(examples): Fix tower examples (#624)
Doing ```rust let clone = self.inner.clone(); Box::pin(async move { let response = clone.call(request).await?; Ok(response) }) ``` If `self.inner` is (or contains) a `tower::buffer::Buffer` might panic. That is because cloning a `Buffer` drops the permit that was acquired in `poll_ready`, meaning it is no longer ready and panic in `call`. The solution is to use `mem::replace` to take the ready service and pass that into the async block. Fixes #545
- Loading branch information
1 parent
4b26e78
commit 4a917a3
Showing
2 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters