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

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

Merged
merged 1 commit into from Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions services/shuttle-axum/src/lib.rs
Expand Up @@ -18,7 +18,7 @@ use shuttle_runtime::{CustomError, Error};
use std::net::SocketAddr;

/// A wrapper type for [axum::Router] so we can implement [shuttle_runtime::Service] for it.
pub struct AxumService<S = ()>(pub axum::Router<S>);
pub struct AxumService(pub axum::Router);

#[shuttle_runtime::async_trait]
impl shuttle_runtime::Service for AxumService {
Expand All @@ -34,11 +34,10 @@ impl shuttle_runtime::Service for AxumService {
}
}

impl<S> From<axum::Router<S>> for AxumService<S> {
fn from(router: axum::Router<S>) -> Self {
impl From<axum::Router> for AxumService {
fn from(router: axum::Router) -> Self {
Self(router)
}
}

/// The return type that should be returned from the [shuttle_runtime::main] function.
pub type ShuttleAxum = Result<AxumService, Error>;