From e41f52e84bdab706d3eec8e3bcdfb45e5ff094c0 Mon Sep 17 00:00:00 2001 From: Samir Talwar Date: Wed, 11 Oct 2023 00:21:32 +0200 Subject: [PATCH] Relax constraints on `JsonResponse`. --- rust-connector-sdk/src/json_response.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust-connector-sdk/src/json_response.rs b/rust-connector-sdk/src/json_response.rs index cc96b4ac..f6a20274 100644 --- a/rust-connector-sdk/src/json_response.rs +++ b/rust-connector-sdk/src/json_response.rs @@ -7,7 +7,7 @@ use http::{header, HeaderValue}; /// The value may be of a type that implements `serde::Serialize`, or it may be /// a contiguous sequence of bytes, which are _assumed_ to be valid JSON. #[derive(Debug, Clone)] -pub enum JsonResponse serde::Deserialize<'de>)> { +pub enum JsonResponse { /// A value that can be serialized to JSON. Value(A), /// A serialized JSON bytestring that is assumed to represent a value of @@ -16,7 +16,7 @@ pub enum JsonResponse serde::Deserialize<'de>)> Serialized(Bytes), } -impl serde::Deserialize<'de>)> JsonResponse { +impl serde::Deserialize<'de>)> JsonResponse { /// Unwraps the value, deserializing if necessary. /// /// This is only intended for testing and compatibility. If it lives on a @@ -33,7 +33,7 @@ impl serde::Deserialize<'de>)> JsonResponse { } } -impl serde::Deserialize<'de>)> IntoResponse for JsonResponse { +impl IntoResponse for JsonResponse { fn into_response(self) -> axum::response::Response { match self { JsonResponse::Value(value) => axum::Json(value).into_response(),