From fe72cd993bad4ea6f1ece11934806fac28dfac66 Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Tue, 22 Mar 2022 18:00:30 +0800 Subject: [PATCH] Fixup --- src/query/json.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/query/json.rs b/src/query/json.rs index 42cc55c6c..307d00189 100644 --- a/src/query/json.rs +++ b/src/query/json.rs @@ -9,13 +9,10 @@ impl FromQueryResult for JsonValue { macro_rules! try_get_type { ( $type: ty, $col: ident ) => { if let Ok(v) = res.try_get::>(pre, &$col) { - map.insert( - $col.to_owned(), - json!(v), - ); + map.insert($col.to_owned(), json!(v)); continue; } - } + }; } match &res.row { #[cfg(feature = "sqlx-mysql")] @@ -58,9 +55,9 @@ impl FromQueryResult for JsonValue { match_mysql_type!(chrono::DateTime); #[cfg(feature = "with-rust_decimal")] match_mysql_type!(rust_decimal::Decimal); - try_get_type!(String, col); #[cfg(feature = "with-json")] try_get_type!(serde_json::Value, col); + try_get_type!(String, col); #[cfg(feature = "with-uuid")] try_get_type!(uuid::Uuid, col); try_get_type!(Vec, col); @@ -106,9 +103,9 @@ impl FromQueryResult for JsonValue { match_postgres_type!(chrono::DateTime); #[cfg(feature = "with-rust_decimal")] match_postgres_type!(rust_decimal::Decimal); - try_get_type!(String, col); #[cfg(feature = "with-json")] try_get_type!(serde_json::Value, col); + try_get_type!(String, col); #[cfg(feature = "with-uuid")] try_get_type!(uuid::Uuid, col); try_get_type!(Vec, col);