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

cleanup and cargo fmt

This commit is contained in:
Nikolay Kim
2018-05-20 21:03:29 -07:00
parent 2d97219195
commit e4f1833215
28 changed files with 108 additions and 112 deletions

View File

@ -35,10 +35,10 @@ impl Handler<CreateUser> for DbExecutor {
&[&uuid, &msg.name],
).unwrap();
Ok(conn.query_row(
"SELECT name FROM users WHERE id=$1",
&[&uuid],
|row| row.get(0),
).map_err(|_| io::Error::new(io::ErrorKind::Other, "db error"))?)
Ok(conn
.query_row("SELECT name FROM users WHERE id=$1", &[&uuid], |row| {
row.get(0)
})
.map_err(|_| io::Error::new(io::ErrorKind::Other, "db error"))?)
}
}

View File

@ -11,8 +11,9 @@ extern crate serde_json;
extern crate uuid;
use actix::prelude::*;
use actix_web::{http, middleware, server, App, AsyncResponder, Error, HttpRequest,
HttpResponse};
use actix_web::{
http, middleware, server, App, AsyncResponder, Error, HttpRequest, HttpResponse,
};
use futures::future::Future;
use r2d2_sqlite::SqliteConnectionManager;