Skip to content

Commit

Permalink
cleanup doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Apr 9, 2018
1 parent eb66685 commit 5617896
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/diesel/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions src/middleware/csrf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
//!
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/pred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ impl<S: 'static> Predicate<S> for AnyPredicate<S> {
///
/// ```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")))
Expand Down

0 comments on commit 5617896

Please sign in to comment.