From 561789678089b5ad05a66f4b8a38a0a640b97189 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 9 Apr 2018 10:40:12 -0700 Subject: [PATCH] cleanup doc tests --- examples/diesel/src/db.rs | 2 +- src/middleware/csrf.rs | 7 +++---- src/pred.rs | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/diesel/src/db.rs b/examples/diesel/src/db.rs index 13b376823..78806c272 100644 --- a/examples/diesel/src/db.rs +++ b/examples/diesel/src/db.rs @@ -4,7 +4,7 @@ use diesel; use actix_web::*; use actix::prelude::*; use diesel::prelude::*; -use diesel::r2d2::{ Pool, ConnectionManager }; +use diesel::r2d2::{Pool, ConnectionManager}; use models; use schema; diff --git a/src/middleware/csrf.rs b/src/middleware/csrf.rs index a80b17cb6..ba99b1f5b 100644 --- a/src/middleware/csrf.rs +++ b/src/middleware/csrf.rs @@ -14,7 +14,7 @@ //! * There is no `Origin` header but the `Referer` header matches one of //! the allowed origins. //! -//! Use [`CsrfFilterBuilder::allow_xhr()`](struct.CsrfFilterBuilder.html#method.allow_xhr) +//! Use [`CsrfFilter::allow_xhr()`](struct.CsrfFilter.html#method.allow_xhr) //! if you want to allow requests with unsafe methods via //! [CORS](../cors/struct.Cors.html). //! @@ -32,9 +32,8 @@ //! fn main() { //! let app = App::new() //! .middleware( -//! csrf::CsrfFilter::build() -//! .allowed_origin("https://www.example.com") -//! .finish()) +//! csrf::CsrfFilter::new() +//! .allowed_origin("https://www.example.com")) //! .resource("/", |r| { //! r.method(http::Method::GET).f(|_| HttpResponse::Ok()); //! r.method(http::Method::POST).f(handle_post); diff --git a/src/pred.rs b/src/pred.rs index 57398fc2b..7bc8e187f 100644 --- a/src/pred.rs +++ b/src/pred.rs @@ -61,10 +61,10 @@ impl Predicate for AnyPredicate { /// /// ```rust /// # extern crate actix_web; -/// use actix_web::{pred, Application, HttpResponse}; +/// use actix_web::{pred, App, HttpResponse}; /// /// fn main() { -/// Application::new() +/// App::new() /// .resource("/index.html", |r| r.route() /// .filter(pred::All(pred::Get()) /// .and(pred::Header("content-type", "plain/text")))