1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-08-28 10:27:48 +02:00

cargo fmt

This commit is contained in:
Nikolay Kim
2018-06-01 09:37:14 -07:00
parent 154cd3c5de
commit 3f5a39a5b7
21 changed files with 279 additions and 251 deletions

View File

@@ -22,8 +22,8 @@
//!
//! ```
//! # extern crate actix_web;
//! use actix_web::{http, App, HttpRequest, HttpResponse};
//! use actix_web::middleware::csrf;
//! use actix_web::{http, App, HttpRequest, HttpResponse};
//!
//! fn handle_post(_: HttpRequest) -> &'static str {
//! "This action should only be triggered with requests from the same site"
@@ -32,8 +32,8 @@
//! fn main() {
//! let app = App::new()
//! .middleware(
//! csrf::CsrfFilter::new()
//! .allowed_origin("https://www.example.com"))
//! 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);
@@ -120,13 +120,12 @@ fn origin(headers: &HeaderMap) -> Option<Result<Cow<str>, CsrfError>> {
/// # Example
///
/// ```
/// use actix_web::App;
/// use actix_web::middleware::csrf;
/// use actix_web::App;
///
/// # fn main() {
/// let app = App::new().middleware(
/// csrf::CsrfFilter::new()
/// .allowed_origin("https://www.example.com"));
/// let app = App::new()
/// .middleware(csrf::CsrfFilter::new().allowed_origin("https://www.example.com"));
/// # }
/// ```
#[derive(Default)]