fix format

This commit is contained in:
al8n 2022-05-21 13:55:58 +08:00
parent 318c3dfc97
commit 2da09de179
3 changed files with 7 additions and 7 deletions

View File

@ -14,12 +14,12 @@ impl ScalarType for BigDecimal {
}
if let Some(f) = n.as_i64() {
return Ok(BigDecimal::from(f));
return Ok(BigDecimal::from(f));
}
// unwrap safe here, because we have check the other possibility
Ok(BigDecimal::from(n.as_u64().unwrap()))
},
}
Value::String(s) => Ok(BigDecimal::from_str(s)?),
_ => Err(InputValueError::expected_type(value)),
}
@ -28,4 +28,4 @@ impl ScalarType for BigDecimal {
fn to_value(&self) -> Value {
Value::String(self.to_string())
}
}
}

View File

@ -15,12 +15,12 @@ impl ScalarType for Decimal {
}
if let Some(f) = n.as_i64() {
return Ok(Decimal::from(f));
return Ok(Decimal::from(f));
}
// unwrap safe here, because we have check the other possibility
Ok(Decimal::from(n.as_u64().unwrap()))
},
}
_ => Err(InputValueError::expected_type(value)),
}
}

View File

@ -15,6 +15,8 @@ mod string;
#[cfg(feature = "tokio-sync")]
mod tokio;
#[cfg(feature = "bigdecimal")]
mod big_decimal;
#[cfg(feature = "bson")]
mod bson;
#[cfg(feature = "chrono-tz")]
@ -23,8 +25,6 @@ mod chrono_tz;
mod datetime;
#[cfg(feature = "decimal")]
mod decimal;
#[cfg(feature = "bigdecimal")]
mod big_decimal;
#[cfg(feature = "chrono-duration")]
mod duration;
#[cfg(feature = "chrono")]