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

Misc documentation improvements #1647

Merged
merged 7 commits into from Jan 7, 2023
Merged

Misc documentation improvements #1647

merged 7 commits into from Jan 7, 2023

Conversation

davidpdrsn
Copy link
Member

  • Add examples to methods in RequestPartsExt and RequestExt
  • Mention that State is global within the router
  • Point to from_fn_with_state in from_fn docs
  • Tweak from_fn examples a bit

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
@davidpdrsn davidpdrsn enabled auto-merge (squash) December 16, 2022 10:30
///
/// if content_type.starts_with("application/json") {
/// let Json(payload) = req
/// .extract::<Json<T>, _>()
Copy link
Member

Choose a reason for hiding this comment

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

Are all these extracts[_parts] turbofishes needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not strictly no but I've seen users be confused about what M is in fn extract<E, M> not realizing they can use _ and rely on inference. So I wanted to explicitly show that.

@davidpdrsn davidpdrsn merged commit 1aa357c into main Jan 7, 2023
@davidpdrsn davidpdrsn deleted the docs branch January 7, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants