Skip to content

Revert "feat(shuttle-axum) Make AxumService generic to be able to use axum::State with it (#924)"#1199

Merged
chesedo merged 1 commit intoshuttle-hq:mainfrom
jonaro00:revert-axum-generic
Sep 8, 2023
Merged

Revert "feat(shuttle-axum) Make AxumService generic to be able to use axum::State with it (#924)"#1199
chesedo merged 1 commit intoshuttle-hq:mainfrom
jonaro00:revert-axum-generic

Conversation

@jonaro00
Copy link
Copy Markdown
Member

@jonaro00 jonaro00 commented Sep 5, 2023

This reverts commit e6ade25.

Description of change

An axum router with <S != ()> cannot be turned into a service. IT is only implemented for <S = ()> https://docs.rs/axum/latest/axum/struct.Router.html#impl-Router%3C(),+B%3E
The generic <S> means which state the router is missing. https://docs.rs/axum/latest/axum/routing/struct.Router.html#what-s-in-routers-means

How has this been tested? (if applicable)

The example that was created for "verifying" #924, shuttle-hq/shuttle-examples#52, did not verify the functionality of the generic (it's a good example tho). If you try setting S to anything, your code will now compile.
Basically, #924 was never fully tested.

@jonaro00
Copy link
Copy Markdown
Member Author

jonaro00 commented Sep 5, 2023

@morlinbrot I'm curios what you think. Am I right or wrong?

@chesedo chesedo merged commit fa86d5b into shuttle-hq:main Sep 8, 2023
@jonaro00 jonaro00 deleted the revert-axum-generic branch September 8, 2023 10:04
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.

4 participants