From e6ade25efbca897a732ee3bb4f7de285b8e16d50 Mon Sep 17 00:00:00 2001 From: Zisulin Morbrot <22527555+morlinbrot@users.noreply.github.com> Date: Thu, 25 May 2023 09:05:19 +0200 Subject: [PATCH] feat(shuttle-axum) Make AxumService generic to be able to use axum::State with it (#924) --- services/shuttle-axum/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/shuttle-axum/src/lib.rs b/services/shuttle-axum/src/lib.rs index 6ca9589ff..3734740dd 100644 --- a/services/shuttle-axum/src/lib.rs +++ b/services/shuttle-axum/src/lib.rs @@ -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(pub axum::Router); +pub struct AxumService(pub axum::Router); #[shuttle_runtime::async_trait] impl shuttle_runtime::Service for AxumService { @@ -34,10 +34,11 @@ impl shuttle_runtime::Service for AxumService { } } -impl From for AxumService { - fn from(router: axum::Router) -> Self { +impl From> 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;