1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-07-31 07:23:57 +02:00

clippy warnings; fmt

This commit is contained in:
Nikolay Kim
2018-04-28 22:55:47 -07:00
parent a38c3985f6
commit de49796fd1
67 changed files with 988 additions and 1866 deletions

View File

@@ -89,10 +89,7 @@ fn origin(headers: &HeaderMap) -> Option<Result<Cow<str>, CsrfError>> {
headers
.get(header::ORIGIN)
.map(|origin| {
origin
.to_str()
.map_err(|_| CsrfError::BadOrigin)
.map(|o| o.into())
origin.to_str().map_err(|_| CsrfError::BadOrigin).map(|o| o.into())
})
.or_else(|| {
headers.get(header::REFERER).map(|referer| {
@@ -261,9 +258,8 @@ mod tests {
fn test_upgrade() {
let strict_csrf = CsrfFilter::new().allowed_origin("https://www.example.com");
let lax_csrf = CsrfFilter::new()
.allowed_origin("https://www.example.com")
.allow_upgrade();
let lax_csrf =
CsrfFilter::new().allowed_origin("https://www.example.com").allow_upgrade();
let mut req = TestRequest::with_header("Origin", "https://cswsh.com")
.header("Connection", "Upgrade")