From 9b7f2395e58a4ff086a3199502a91f533a4741f2 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 7 Oct 2017 00:31:40 -0700 Subject: [PATCH] better naming --- src/resource.rs | 6 ++---- src/route.rs | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/resource.rs b/src/resource.rs index 05806843b..80b06bf43 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -100,10 +100,8 @@ impl HttpMessage where A: Actor> + Route HttpMessage(HttpMessageItem::Actor(act)) } - /// Create response with empty body - pub fn reply(req: HttpRequest, msg: I) -> Self - where I: IntoHttpResponse - { + /// Send response + pub fn reply(req: HttpRequest, msg: I) -> Self { HttpMessage(HttpMessageItem::Message(msg.into_response(req))) } diff --git a/src/route.rs b/src/route.rs index c214de73a..c8c3b4b97 100644 --- a/src/route.rs +++ b/src/route.rs @@ -66,10 +66,8 @@ pub trait Route: Actor> { HttpMessage::stream(act) } - /// Create response - fn http_reply(req: HttpRequest, msg: I) -> HttpMessage - where I: IntoHttpResponse - { + /// Send response + fn http_reply(req: HttpRequest, msg: I) -> HttpMessage { HttpMessage::reply(req, msg) } }