Run cargo fmt

This commit is contained in:
Ryan Leckey 2019-12-27 20:44:03 -08:00
parent 9186400668
commit 56a82346f2
5 changed files with 14 additions and 5 deletions

View File

@ -52,4 +52,4 @@ async fn register(mut req: Request<Pool<Postgres>>) -> Response {
Response::new(200)
.body_json(&RegisterResponseBody { id: user_id })
.unwrap()
}
}

View File

@ -36,6 +36,9 @@ impl Encode<MySql> for String {
impl Decode<MySql> for String {
fn decode(mut buf: &[u8]) -> Result<Self, DecodeError> {
Ok(buf.get_str_lenenc::<LittleEndian>()?.unwrap_or_default().to_owned())
Ok(buf
.get_str_lenenc::<LittleEndian>()?
.unwrap_or_default()
.to_owned())
}
}

View File

@ -17,7 +17,7 @@ macro_rules! test {
.await?;
assert_eq!(row.get::<i32, _>(0), 1);
let value = row.get::<$ty, _>("_1");
assert!($value == value);

View File

@ -37,7 +37,10 @@ CREATE TEMPORARY TABLE users (id INTEGER PRIMARY KEY)
let sum: i32 = sqlx::query("SELECT id FROM users")
.fetch(&mut conn)
.try_fold(0_i32, |acc, x| async move { Ok(acc + x.get::<i32, _>("id")) })
.try_fold(
0_i32,
|acc, x| async move { Ok(acc + x.get::<i32, _>("id")) },
)
.await?;
assert_eq!(sum, 55);

View File

@ -61,7 +61,10 @@ CREATE TEMPORARY TABLE users (id INTEGER PRIMARY KEY);
let sum: i32 = sqlx::query("SELECT id FROM users")
.fetch(&mut conn)
.try_fold(0_i32, |acc, x| async move { Ok(acc + x.get::<i32, _>("id")) })
.try_fold(
0_i32,
|acc, x| async move { Ok(acc + x.get::<i32, _>("id")) },
)
.await?;
assert_eq!(sum, 55);