1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 00:21:08 +01:00

Updating docs for HttpResponseBuilder::del_cookie

This commit is contained in:
svartalf 2018-05-24 21:36:17 +03:00
parent 111b6835fa
commit 36f933ce1d

View File

@ -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() {