mirror of
https://github.com/actix/examples
synced 2025-06-28 09:50:36 +02:00
Run rustfmt
This commit is contained in:
@ -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()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user