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

Run rustfmt

This commit is contained in:
Yuki Okushi
2020-04-03 16:16:17 +09:00
parent 8f1c0a85cf
commit 046604f286
5 changed files with 42 additions and 49 deletions

View File

@ -33,27 +33,26 @@ impl User {
fn products(&self, context: &Context) -> Vec<Product> {
let mut conn = context.dbpool.get().unwrap();
conn
.prep_exec(
"select * from product where user_id=:user_id",
params! {
"user_id" => &self.id
},
)
.map(|result| {
result
.map(|x| x.unwrap())
.map(|mut row| {
let (id, user_id, name, price) = from_row(row);
Product {
id,
user_id,
name,
price,
}
})
.collect()
})
.unwrap()
conn.prep_exec(
"select * from product where user_id=:user_id",
params! {
"user_id" => &self.id
},
)
.map(|result| {
result
.map(|x| x.unwrap())
.map(|mut row| {
let (id, user_id, name, price) = from_row(row);
Product {
id,
user_id,
name,
price,
}
})
.collect()
})
.unwrap()
}
}