Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Mar 22, 2022
1 parent 0e99349 commit fe72cd9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/query/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ impl FromQueryResult for JsonValue {
macro_rules! try_get_type {
( $type: ty, $col: ident ) => {
if let Ok(v) = res.try_get::<Option<$type>>(pre, &$col) {
map.insert(
$col.to_owned(),
json!(v),
);
map.insert($col.to_owned(), json!(v));
continue;
}
}
};
}
match &res.row {
#[cfg(feature = "sqlx-mysql")]
Expand Down Expand Up @@ -58,9 +55,9 @@ impl FromQueryResult for JsonValue {
match_mysql_type!(chrono::DateTime<chrono::Utc>);
#[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<u8>, col);
Expand Down Expand Up @@ -106,9 +103,9 @@ impl FromQueryResult for JsonValue {
match_postgres_type!(chrono::DateTime<chrono::FixedOffset>);
#[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<u8>, col);
Expand Down

0 comments on commit fe72cd9

Please sign in to comment.