Fix smol_str feature

This commit is contained in:
Steven Fackler 2022-08-20 15:18:19 -04:00
parent 91b21873ca
commit d6a6e9db83
No known key found for this signature in database
GPG Key ID: 30A04EB23B15B465
6 changed files with 33 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "postgres-types"
version = "0.2.3"
version = "0.2.4"
authors = ["Steven Fackler <sfackler@gmail.com>"]
edition = "2018"
license = "MIT/Apache-2.0"
@ -21,6 +21,7 @@ with-eui48-1 = ["eui48-1"]
with-geo-types-0_6 = ["geo-types-06"]
with-geo-types-0_7 = ["geo-types-0_7"]
with-serde_json-1 = ["serde-1", "serde_json-1"]
with-smol_str-01 = ["smol_str-01"]
with-uuid-0_8 = ["uuid-08"]
with-uuid-1 = ["uuid-1"]
with-time-0_2 = ["time-02"]
@ -48,5 +49,4 @@ uuid-08 = { version = "0.8", package = "uuid", optional = true }
uuid-1 = { version = "1.0", package = "uuid", optional = true }
time-02 = { version = "0.2", package = "time", optional = true }
time-03 = { version = "0.3", package = "time", default-features = false, optional = true }
smol_str-01 = { version = "0.1.23", package = "smol_str", default-features = false, optional = true }

View File

@ -224,7 +224,7 @@ mod geo_types_06;
mod geo_types_07;
#[cfg(feature = "with-serde_json-1")]
mod serde_json_1;
#[cfg(feature = "smol_str-01")]
#[cfg(feature = "with-smol_str-01")]
mod smol_str_01;
#[cfg(feature = "with-time-0_2")]
mod time_02;

View File

@ -29,6 +29,7 @@ with-eui48-1 = ["tokio-postgres/with-eui48-1"]
with-geo-types-0_6 = ["tokio-postgres/with-geo-types-0_6"]
with-geo-types-0_7 = ["tokio-postgres/with-geo-types-0_7"]
with-serde_json-1 = ["tokio-postgres/with-serde_json-1"]
with-smol_str-01 = ["tokio-postgres/with-smol_str-01"]
with-uuid-0_8 = ["tokio-postgres/with-uuid-0_8"]
with-uuid-1 = ["tokio-postgres/with-uuid-1"]
with-time-0_2 = ["tokio-postgres/with-time-0_2"]

View File

@ -35,6 +35,7 @@ with-eui48-1 = ["postgres-types/with-eui48-1"]
with-geo-types-0_6 = ["postgres-types/with-geo-types-0_6"]
with-geo-types-0_7 = ["postgres-types/with-geo-types-0_7"]
with-serde_json-1 = ["postgres-types/with-serde_json-1"]
with-smol_str-01 = ["postgres-types/with-smol_str-01"]
with-uuid-0_8 = ["postgres-types/with-uuid-0_8"]
with-uuid-1 = ["postgres-types/with-uuid-1"]
with-time-0_2 = ["postgres-types/with-time-0_2"]
@ -62,7 +63,13 @@ tokio-util = { version = "0.7", features = ["codec"] }
futures-executor = "0.3"
criterion = "0.3"
env_logger = "0.9"
tokio = { version = "1.0", features = ["macros", "net", "rt", "rt-multi-thread", "time"] }
tokio = { version = "1.0", features = [
"macros",
"net",
"rt",
"rt-multi-thread",
"time",
] }
bit-vec-06 = { version = "0.6", package = "bit-vec" }
chrono-04 = { version = "0.4", package = "chrono", default-features = false }
@ -72,6 +79,7 @@ geo-types-06 = { version = "0.6", package = "geo-types" }
geo-types-07 = { version = "0.7", package = "geo-types" }
serde-1 = { version = "1.0", package = "serde" }
serde_json-1 = { version = "1.0", package = "serde_json" }
smol_str-01 = { version = "0.1", package = "smol_str" }
uuid-08 = { version = "0.8", package = "uuid" }
uuid-1 = { version = "1.0", package = "uuid" }
time-02 = { version = "0.2", package = "time" }

View File

@ -27,6 +27,8 @@ mod geo_types_06;
mod geo_types_07;
#[cfg(feature = "with-serde_json-1")]
mod serde_json_1;
#[cfg(feature = "with-smol_str-01")]
mod smol_str_01;
#[cfg(feature = "with-time-0_2")]
mod time_02;
#[cfg(feature = "with-time-0_3")]

View File

@ -0,0 +1,18 @@
use smol_str_01::SmolStr;
use crate::types::test_type;
#[tokio::test]
async fn test_smol_str() {
test_type(
"VARCHAR",
&[
(Some(SmolStr::new("hello world")), "'hello world'"),
(
Some(SmolStr::new("イロハニホヘト チリヌルヲ")),
"'イロハニホヘト チリヌルヲ'",
),
(None, "NULL"),
]
).await;
}