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

Make MockRequestDispatcher::with_request_checker to owned request #1930

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

Conversation

allada
Copy link

@allada allada commented Apr 18, 2021

Currently MockRequestDispatcher::with_request_checker takes a Fn
that passes a non-mutable reference to the checker function. This
causes issues for users who wish to check a streamed payload's
contents because it is immutable. By making it owned it will no
longer be a problem.


This change is Reviewable

@allada
Copy link
Author

allada commented Apr 18, 2021

I'm happy to write a test for this if @benesch gives the soft go-ahead. This is a minor-breaking change. It's very minor because it should be as trivial as using .as_ref() or & if they cannot use the owned version.

@allada allada changed the title Make MockRequestDispatcher::with_request_checker to own request Make MockRequestDispatcher::with_request_checker to owned request Apr 18, 2021
Currently MockRequestDispatcher::with_request_checker takes a Fn
that passes a non-mutable reference to the checker function. This
causes issues for users who wish to check a streamed payload's
contents because it is immutable. By making it owned it will no
longer be a problem.
@allada allada force-pushed the with_request_checker-owned branch from 4c23423 to d357bea Compare April 18, 2021 23:22
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.

None yet

1 participant