From c6fa9047b97b3e68f5356a3a32e1b198ceee5a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=BF=B1=E7=BF=94?= Date: Wed, 29 Jul 2020 10:46:16 +0800 Subject: [PATCH] Remove rust_decimal unnecessary num-traits --- Cargo.lock | 1 - sqlx-core/Cargo.toml | 5 ++--- sqlx-core/src/postgres/types/decimal.rs | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7019d74..ff85040e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2067,7 +2067,6 @@ dependencies = [ "md-5", "memchr", "num-bigint", - "num-traits", "once_cell", "parking_lot", "percent-encoding", diff --git a/sqlx-core/Cargo.toml b/sqlx-core/Cargo.toml index 8e6fba71..70470120 100644 --- a/sqlx-core/Cargo.toml +++ b/sqlx-core/Cargo.toml @@ -27,7 +27,7 @@ any = [] # types all-types = [ "chrono", "time", "bigdecimal", "decimal", "ipnetwork", "json", "uuid", "bit-vec" ] bigdecimal = [ "bigdecimal_", "num-bigint" ] -decimal = [ "rust_decimal", "num-bigint", "num-traits" ] +decimal = [ "rust_decimal", "num-bigint" ] json = [ "serde", "serde_json" ] # runtimes @@ -43,8 +43,7 @@ atoi = "0.3.2" sqlx-rt = { path = "../sqlx-rt", version = "0.1.1" } base64 = { version = "0.12.1", default-features = false, optional = true, features = [ "std" ] } bigdecimal_ = { version = "0.1.0", optional = true, package = "bigdecimal" } -rust_decimal = { version = "1.6.0", optional = true } -num-traits = { version = "0.2.12", optional = true } +rust_decimal = { version = "1.7.0", optional = true } bit-vec = { version = "0.6.2", optional = true } bitflags = { version = "1.2.1", default-features = false } bytes = "0.5.4" diff --git a/sqlx-core/src/postgres/types/decimal.rs b/sqlx-core/src/postgres/types/decimal.rs index 2224e1a2..e9e86181 100644 --- a/sqlx-core/src/postgres/types/decimal.rs +++ b/sqlx-core/src/postgres/types/decimal.rs @@ -1,6 +1,5 @@ use num_bigint::{BigInt, Sign}; -use num_traits::ToPrimitive; -use rust_decimal::{prelude::Zero, Decimal}; +use rust_decimal::{Decimal, prelude::{Zero, ToPrimitive}}; use std::convert::{TryFrom, TryInto}; use crate::decode::Decode;