Skip to content

Conversation

@braddunbar
Copy link
Contributor

Motivation

We don't need to go through Extension<T>::from_request_parts and build an error to throw away when we have direct access to parts.extensions.

Solution

Use parts.extensions directly to get the cached value.

We don't need to go through `Extension<T>::from_request_parts` and build
an error to throw away when we have direct access to `parts.extensions`.
Copy link
Member

@jplatte jplatte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also gets rid of a pointless await point. Thanks!

@jplatte jplatte merged commit efc1f57 into tokio-rs:main Oct 30, 2025
18 checks passed
@yanns
Copy link
Collaborator

yanns commented Oct 30, 2025

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants