Skip to content

Commit d6a6e9d

Browse files
committed
Fix smol_str feature
1 parent 91b2187 commit d6a6e9d

File tree

6 files changed

+33
-4
lines changed

6 files changed

+33
-4
lines changed

postgres-types/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "postgres-types"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
authors = ["Steven Fackler <[email protected]>"]
55
edition = "2018"
66
license = "MIT/Apache-2.0"
@@ -21,6 +21,7 @@ with-eui48-1 = ["eui48-1"]
2121
with-geo-types-0_6 = ["geo-types-06"]
2222
with-geo-types-0_7 = ["geo-types-0_7"]
2323
with-serde_json-1 = ["serde-1", "serde_json-1"]
24+
with-smol_str-01 = ["smol_str-01"]
2425
with-uuid-0_8 = ["uuid-08"]
2526
with-uuid-1 = ["uuid-1"]
2627
with-time-0_2 = ["time-02"]
@@ -48,5 +49,4 @@ uuid-08 = { version = "0.8", package = "uuid", optional = true }
4849
uuid-1 = { version = "1.0", package = "uuid", optional = true }
4950
time-02 = { version = "0.2", package = "time", optional = true }
5051
time-03 = { version = "0.3", package = "time", default-features = false, optional = true }
51-
5252
smol_str-01 = { version = "0.1.23", package = "smol_str", default-features = false, optional = true }

postgres-types/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ mod geo_types_06;
224224
mod geo_types_07;
225225
#[cfg(feature = "with-serde_json-1")]
226226
mod serde_json_1;
227-
#[cfg(feature = "smol_str-01")]
227+
#[cfg(feature = "with-smol_str-01")]
228228
mod smol_str_01;
229229
#[cfg(feature = "with-time-0_2")]
230230
mod time_02;

postgres/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ with-eui48-1 = ["tokio-postgres/with-eui48-1"]
2929
with-geo-types-0_6 = ["tokio-postgres/with-geo-types-0_6"]
3030
with-geo-types-0_7 = ["tokio-postgres/with-geo-types-0_7"]
3131
with-serde_json-1 = ["tokio-postgres/with-serde_json-1"]
32+
with-smol_str-01 = ["tokio-postgres/with-smol_str-01"]
3233
with-uuid-0_8 = ["tokio-postgres/with-uuid-0_8"]
3334
with-uuid-1 = ["tokio-postgres/with-uuid-1"]
3435
with-time-0_2 = ["tokio-postgres/with-time-0_2"]

tokio-postgres/Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ with-eui48-1 = ["postgres-types/with-eui48-1"]
3535
with-geo-types-0_6 = ["postgres-types/with-geo-types-0_6"]
3636
with-geo-types-0_7 = ["postgres-types/with-geo-types-0_7"]
3737
with-serde_json-1 = ["postgres-types/with-serde_json-1"]
38+
with-smol_str-01 = ["postgres-types/with-smol_str-01"]
3839
with-uuid-0_8 = ["postgres-types/with-uuid-0_8"]
3940
with-uuid-1 = ["postgres-types/with-uuid-1"]
4041
with-time-0_2 = ["postgres-types/with-time-0_2"]
@@ -62,7 +63,13 @@ tokio-util = { version = "0.7", features = ["codec"] }
6263
futures-executor = "0.3"
6364
criterion = "0.3"
6465
env_logger = "0.9"
65-
tokio = { version = "1.0", features = ["macros", "net", "rt", "rt-multi-thread", "time"] }
66+
tokio = { version = "1.0", features = [
67+
"macros",
68+
"net",
69+
"rt",
70+
"rt-multi-thread",
71+
"time",
72+
] }
6673

6774
bit-vec-06 = { version = "0.6", package = "bit-vec" }
6875
chrono-04 = { version = "0.4", package = "chrono", default-features = false }
@@ -72,6 +79,7 @@ geo-types-06 = { version = "0.6", package = "geo-types" }
7279
geo-types-07 = { version = "0.7", package = "geo-types" }
7380
serde-1 = { version = "1.0", package = "serde" }
7481
serde_json-1 = { version = "1.0", package = "serde_json" }
82+
smol_str-01 = { version = "0.1", package = "smol_str" }
7583
uuid-08 = { version = "0.8", package = "uuid" }
7684
uuid-1 = { version = "1.0", package = "uuid" }
7785
time-02 = { version = "0.2", package = "time" }

tokio-postgres/tests/test/types/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ mod geo_types_06;
2727
mod geo_types_07;
2828
#[cfg(feature = "with-serde_json-1")]
2929
mod serde_json_1;
30+
#[cfg(feature = "with-smol_str-01")]
31+
mod smol_str_01;
3032
#[cfg(feature = "with-time-0_2")]
3133
mod time_02;
3234
#[cfg(feature = "with-time-0_3")]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use smol_str_01::SmolStr;
2+
3+
use crate::types::test_type;
4+
5+
#[tokio::test]
6+
async fn test_smol_str() {
7+
test_type(
8+
"VARCHAR",
9+
&[
10+
(Some(SmolStr::new("hello world")), "'hello world'"),
11+
(
12+
Some(SmolStr::new("イロハニホヘト チリヌルヲ")),
13+
"'イロハニホヘト チリヌルヲ'",
14+
),
15+
(None, "NULL"),
16+
]
17+
).await;
18+
}

0 commit comments

Comments
 (0)