1
0
mirror of https://github.com/actix/examples synced 2025-06-28 18:00:37 +02:00

Fix clippy warnings (#168)

This commit is contained in:
Yuki Okushi
2019-09-05 00:04:57 +09:00
committed by GitHub
parent bb639d5fe3
commit f232b6c684
18 changed files with 41 additions and 46 deletions

View File

@ -3,7 +3,10 @@ use actix_identity::{CookieIdentityPolicy, IdentityService};
use actix_web::{middleware, web, App, HttpResponse, HttpServer};
fn index(id: Identity) -> String {
format!("Hello {}", id.identity().unwrap_or("Anonymous".to_owned()))
format!(
"Hello {}",
id.identity().unwrap_or_else(|| "Anonymous".to_owned())
)
}
fn login(id: Identity) -> HttpResponse {