From 36f933ce1df5efc52cff6615b37fdcf3290f845d Mon Sep 17 00:00:00 2001 From: svartalf Date: Thu, 24 May 2018 21:36:17 +0300 Subject: [PATCH] Updating docs for HttpResponseBuilder::del_cookie --- src/httpresponse.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/httpresponse.rs b/src/httpresponse.rs index 428ca014..ec3c9562 100644 --- a/src/httpresponse.rs +++ b/src/httpresponse.rs @@ -458,7 +458,6 @@ impl HttpResponseBuilder { /// .finish()) /// .finish() /// } - /// fn main() {} /// ``` pub fn cookie<'c>(&mut self, cookie: Cookie<'c>) -> &mut Self { if self.cookies.is_none() { @@ -471,8 +470,22 @@ impl HttpResponseBuilder { self } - /// Remove cookie, cookie has to be cookie from `HttpRequest::cookies()` - /// method. + /// Remove cookie + /// + /// ```rust + /// # extern crate actix_web; + /// use actix_web::{http, HttpRequest, HttpResponse, Result}; + /// + /// fn index(req: HttpRequest) -> HttpResponse { + /// let mut builder = HttpResponse::Ok(); + /// + /// if let Some(cookie) = req.cookie("name") { + /// builder.del_cookie(cookie); + /// } + /// + /// builder.finish() + /// } + /// ``` pub fn del_cookie<'a>(&mut self, cookie: &Cookie<'a>) -> &mut Self { { if self.cookies.is_none() {