From d87f396ebfbc3399f1949a36315ce09e577e5ec1 Mon Sep 17 00:00:00 2001 From: bartel Date: Mon, 22 Apr 2024 17:30:05 +0200 Subject: [PATCH] handshake: server: Make 'create_response_with_body' function more generic This makes it more possible to use the library handshake creation when the request and response body types differ. Signed-off-by: bartel --- src/handshake/server.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/handshake/server.rs b/src/handshake/server.rs index bc072ce9..f0c82bbe 100644 --- a/src/handshake/server.rs +++ b/src/handshake/server.rs @@ -86,10 +86,10 @@ pub fn create_response(request: &Request) -> Result { } /// Create a response for the request with a custom body. -pub fn create_response_with_body( - request: &HttpRequest, - generate_body: impl FnOnce() -> T, -) -> Result> { +pub fn create_response_with_body( + request: &HttpRequest, + generate_body: impl FnOnce() -> T2, +) -> Result> { Ok(create_parts(request)?.body(generate_body())?) }