diff --git a/examples/realworld-postgres/src/main.rs b/examples/realworld-postgres/src/main.rs index cd4dcbb3..270cdaff 100644 --- a/examples/realworld-postgres/src/main.rs +++ b/examples/realworld-postgres/src/main.rs @@ -52,4 +52,4 @@ async fn register(mut req: Request>) -> Response { Response::new(200) .body_json(&RegisterResponseBody { id: user_id }) .unwrap() -} \ No newline at end of file +} diff --git a/sqlx-core/src/mysql/types/str.rs b/sqlx-core/src/mysql/types/str.rs index dda70bc4..628ba3d5 100644 --- a/sqlx-core/src/mysql/types/str.rs +++ b/sqlx-core/src/mysql/types/str.rs @@ -36,6 +36,9 @@ impl Encode for String { impl Decode for String { fn decode(mut buf: &[u8]) -> Result { - Ok(buf.get_str_lenenc::()?.unwrap_or_default().to_owned()) + Ok(buf + .get_str_lenenc::()? + .unwrap_or_default() + .to_owned()) } } diff --git a/tests/mysql-types.rs b/tests/mysql-types.rs index f9ae3c03..2d7544f4 100644 --- a/tests/mysql-types.rs +++ b/tests/mysql-types.rs @@ -17,7 +17,7 @@ macro_rules! test { .await?; assert_eq!(row.get::(0), 1); - + let value = row.get::<$ty, _>("_1"); assert!($value == value); diff --git a/tests/mysql.rs b/tests/mysql.rs index a82865c5..575e1fb7 100644 --- a/tests/mysql.rs +++ b/tests/mysql.rs @@ -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::("id")) }) + .try_fold( + 0_i32, + |acc, x| async move { Ok(acc + x.get::("id")) }, + ) .await?; assert_eq!(sum, 55); diff --git a/tests/postgres.rs b/tests/postgres.rs index 56cad8e9..274b76c8 100644 --- a/tests/postgres.rs +++ b/tests/postgres.rs @@ -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::("id")) }) + .try_fold( + 0_i32, + |acc, x| async move { Ok(acc + x.get::("id")) }, + ) .await?; assert_eq!(sum, 55);