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

Expand the docs for Router::with_state #1580

Merged
merged 1 commit into from Nov 27, 2022
Merged

Expand the docs for Router::with_state #1580

merged 1 commit into from Nov 27, 2022

Conversation

davidpdrsn
Copy link
Member

We've heard from a few users who have issues with getting the state types right, especially if they're returning a router (and thus have to name the type) and calling with_state.

This expands the docs for Router::with_state to hopefully provide examples that help but also provide some more intuition for how things work.

@davidpdrsn davidpdrsn added T-docs Topic: documentation A-axum labels Nov 26, 2022
@@ -5,10 +5,9 @@
///
/// See [`State`] for more details on how library authors should use this trait.
///
/// This trait can be derived using `#[derive(axum_macros::FromRef)]`.
/// This trait can be derived using `#[derive(FromRef)]`.
Copy link
Member Author

Choose a reason for hiding this comment

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

The link on this didn't work for some reason but I don't actually think we need it since the macro is exported at the same path as FromRef itself.

Copy link
Member

Choose a reason for hiding this comment

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

Well, there were no square brackets around the code block.

Copy link
Member Author

Choose a reason for hiding this comment

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

Even with I couldn't get it working 🤷

@davidpdrsn davidpdrsn merged commit eb2e933 into main Nov 27, 2022
@davidpdrsn davidpdrsn deleted the expand-state-docs branch November 27, 2022 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-axum T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants