From 9b7f2395e58a4ff086a3199502a91f533a4741f2 Mon Sep 17 00:00:00 2001 From: Nikolay Kim <fafhrd91@gmail.com> 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 05806843..80b06bf4 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -100,10 +100,8 @@ impl<A> HttpMessage<A> where A: Actor<Context=HttpContext<A>> + Route HttpMessage(HttpMessageItem::Actor(act)) } - /// Create response with empty body - pub fn reply<I>(req: HttpRequest, msg: I) -> Self - where I: IntoHttpResponse - { + /// Send response + pub fn reply<I: IntoHttpResponse>(req: HttpRequest, msg: I) -> Self { HttpMessage(HttpMessageItem::Message(msg.into_response(req))) } diff --git a/src/route.rs b/src/route.rs index c214de73..c8c3b4b9 100644 --- a/src/route.rs +++ b/src/route.rs @@ -66,10 +66,8 @@ pub trait Route: Actor<Context=HttpContext<Self>> { HttpMessage::stream(act) } - /// Create response - fn http_reply<I>(req: HttpRequest, msg: I) -> HttpMessage<Self> - where I: IntoHttpResponse - { + /// Send response + fn http_reply<I: IntoHttpResponse>(req: HttpRequest, msg: I) -> HttpMessage<Self> { HttpMessage::reply(req, msg) } }