Skip to content

refactor: middleware transform can take ownership #963

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tisonkun
Copy link
Contributor

@tisonkun tisonkun commented Feb 7, 2025

This is a breaking change. But since we always use middleware.transform exactly once, take the ownership can reduce some unnecessary wrapper.

For example, a middleware can take an owned value, but since transform use &self, when decorate endpoint, you can only pass a ref of that owned value, or copy, or Arc(Mutex).

cc @sunli829 what do you think?

@attila-lin attila-lin added the breaking breaking change label Feb 21, 2025
@sunli829 sunli829 force-pushed the master branch 2 times, most recently from 8f583de to 44a0067 Compare March 17, 2025 04:09
@tisonkun
Copy link
Contributor Author

@sunli829 any follow-up plan?

@sunli829 sunli829 force-pushed the master branch 9 times, most recently from b7798f9 to d501357 Compare March 30, 2025 03:48
@sunli829 sunli829 force-pushed the master branch 4 times, most recently from 1f79548 to cf7780f Compare May 3, 2025 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants