From 2c86a4d34be811c489cb0f37f09506be47905940 Mon Sep 17 00:00:00 2001 From: Tim DuBois Date: Mon, 27 Nov 2023 10:42:41 +0100 Subject: [PATCH] Update Redoc endpoint to axum 0.7 --- utoipa-redoc/Cargo.toml | 2 +- utoipa-redoc/src/axum.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/utoipa-redoc/Cargo.toml b/utoipa-redoc/Cargo.toml index a536d2b9..8399606b 100644 --- a/utoipa-redoc/Cargo.toml +++ b/utoipa-redoc/Cargo.toml @@ -20,4 +20,4 @@ serde_json = { version = "1.0" } utoipa = { version = "4", path = "../utoipa" } actix-web = { version = "4", optional = true, default-features = false } rocket = { version = "0.5.0-rc.3", features = ["json"], optional = true } -axum = { version = "0.6", optional = true } +axum = { version = "0.7", optional = true } diff --git a/utoipa-redoc/src/axum.rs b/utoipa-redoc/src/axum.rs index 474f45d9..9c0cb6d3 100644 --- a/utoipa-redoc/src/axum.rs +++ b/utoipa-redoc/src/axum.rs @@ -1,19 +1,17 @@ #![cfg(feature = "axum")] -use axum::body::HttpBody; use axum::response::Html; use axum::{routing, Router}; use crate::{Redoc, Spec}; -impl<'s, 'u, S: Spec, R, B> From> for Router +impl<'s, 'u, S: Spec, R> From> for Router where R: Clone + Send + Sync + 'static, - B: HttpBody + Send + 'static, 's: 'static, { fn from(value: Redoc<'s, 'u, S>) -> Self { let html = value.to_html(); - Router::::new().route(value.url, routing::get(move || async { Html(html) })) + Router::::new().route(value.url, routing::get(move || async { Html(html) })) } }