Skip to content

Commit e9566e9

Browse files
committed
Cleanup features and update dependencies
* removes `bigdecimal{02|03}` features in favor of `bigdecimal` * drops bigdecimal v0.2.x support * drops time v0.2.x support (and removes `time02` feature) * mekes `derive` the only non-mandatory default feature
1 parent 1e86604 commit e9566e9

9 files changed

Lines changed: 17 additions & 826 deletions

File tree

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: cargo fmt -- --check
2222
- name: Features subsets
2323
run: |
24-
ruby -e "fs=['bigdecimal02', 'bigdecimal03', 'bigdecimal', 'chrono', 'rust_decimal', 'time02', 'time', 'frunk', 'derive', 'binlog']; \
24+
ruby -e "fs=['bigdecimal', 'chrono', 'rust_decimal', 'time', 'frunk', 'derive', 'binlog']; \
2525
(1..fs.length).each do |n| puts fs.combination(n).to_a.map {|x| x.join(\" \")}.join(\"\n\"); end" \
2626
| while read -r line; do \
2727
echo "$line" && cargo check --quiet --tests --no-default-features --features "flate2/zlib test $line" --profile features-subsets; \

Cargo.toml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ travis-ci = { repository = "blackbeam/rust_mysql_common" }
3131

3232
[dependencies]
3333
base64 = "0.22"
34-
bigdecimal02 = { package = "bigdecimal", version = "0.2", features = [
35-
"serde",
36-
], optional = true }
37-
bigdecimal03 = { package = "bigdecimal", version = "0.3", optional = true }
38-
bigdecimal = { version = "0.4", optional = true }
34+
bigdecimal = { version = ">=0.3, <0.5", optional = true }
3935
bitflags = "2.3"
4036
bitvec = { version = "1.0", optional = true }
4137
byteorder = "1"
@@ -56,9 +52,6 @@ rust_decimal = { version = "1.0", optional = true }
5652
sha1 = "0.10"
5753
sha2 = "0.10"
5854
thiserror = "1.0"
59-
time02 = { package = "time", version = "0.2", default-features = false, features = [
60-
"std",
61-
], optional = true }
6255
time = { version = "0.3", default-features = false, features = [
6356
"parsing",
6457
], optional = true }
@@ -91,15 +84,7 @@ strip = "debuginfo"
9184
incremental = false
9285

9386
[features]
94-
default = [
95-
"flate2/zlib",
96-
"bigdecimal",
97-
"rust_decimal",
98-
"time",
99-
"frunk",
100-
"derive",
101-
"binlog",
102-
]
87+
default = ["flate2/zlib", "derive"]
10388
test = ["derive"]
10489
derive = ["mysql-common-derive"]
10590
binlog = ["bitvec"]
@@ -110,12 +95,9 @@ rustdoc-args = ["--cfg", "docsrs"]
11095
no-default-features = true
11196
features = [
11297
"flate2/zlib",
113-
"time02",
11498
"time",
11599
"rust_decimal",
116100
"chrono",
117-
"bigdecimal02",
118-
"bigdecimal03",
119101
"bigdecimal",
120102
"derive",
121103
"binlog",

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ column and protocol type correspondence:
5252
| `mysql_common::Deserialized<T : DeserializeOwned>` | MySql bytes parsed using `serde_json::from_str` |
5353
| `Option<T: FromValue>` | Must be used for nullable columns to avoid errors |
5454
| [`decimal::Decimal`] | MySql int, uint or bytes parsed using `Decimal::from_str`.<br>⚠️ Note that this type doesn't support full range of MySql `DECIMAL` type. |
55-
| [`bigdecimal::BigDecimal`] (v0.2.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
56-
| [`bigdecimal::BigDecimal`] (v0.3.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
57-
| [`bigdecimal::BigDecimal`] (v0.4.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
55+
| [`bigdecimal::BigDecimal`] | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
5856
| `num_bigint::{BigInt, BigUint}` | MySql int, uint or bytes parsed using `_::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql integer types but it'll be serialized anyway (as decimal bytes string). |
5957

6058
Also crate provides from-row convertion for the following list of types (see `FromRow` trait):
@@ -70,16 +68,13 @@ Also crate provides from-row convertion for the following list of types (see `Fr
7068

7169
| Feature | Description | Default |
7270
| -------------- | ---------------------------------------------------- | ------- |
73-
| `bigdecimal02` | Enables `bigdecimal` v0.2.x types support | 🔴 |
74-
| `bigdecimal03` | Enables `bigdecimal` v0.3.x types support | 🔴 |
75-
| `bigdecimal` | Enables `bigdecimal` v0.4.x types support | 🟢 |
71+
| `bigdecimal` | Enables `bigdecimal` >=0.3.x, <0.5.x types support | 🔴 |
7672
| `chrono` | Enables `chrono` types support | 🔴 |
77-
| `rust_decimal` | Enables `rust_decimal` types support | 🟢 |
78-
| `time02` | Enables `time` v0.2.x types support | 🔴 |
79-
| `time` | Enables `time` v0.3.x types support | 🟢 |
80-
| `frunk` | Enables `FromRow` for `frunk::Hlist!` types | 🟢 |
73+
| `rust_decimal` | Enables `rust_decimal` types support | 🔴 |
74+
| `time` | Enables `time` v0.3.x types support | 🔴 |
75+
| `frunk` | Enables `FromRow` for `frunk::Hlist!` types | 🔴 |
8176
| `derive` | Enables [`FromValue` and `FromRow` derive macros][2] | 🟢 |
82-
| `binlog` | Binlog-related functionality | 🟢 |
77+
| `binlog` | Binlog-related functionality | 🔴 |
8378

8479
## Derive Macros
8580

derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bench = false
1919

2020
[dependencies]
2121
darling = "0.20.1"
22-
heck = "0.4.0"
22+
heck = "0.5.0"
2323
num-bigint = "0.4.3"
2424
proc-macro-crate = "3"
2525
proc-macro-error2 = "2.0.1"

src/lib.rs

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@
5252
//! | `mysql_common::Deserialized<T : DeserializeOwned>` | MySql bytes parsed using `serde_json::from_str` |
5353
//! | `Option<T: FromValue>` | Must be used for nullable columns to avoid errors |
5454
//! | [`decimal::Decimal`] | MySql int, uint or bytes parsed using `Decimal::from_str`.<br>⚠️ Note that this type doesn't support full range of MySql `DECIMAL` type. |
55-
//! | [`bigdecimal::BigDecimal`] (v0.2.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
56-
//! | [`bigdecimal::BigDecimal`] (v0.3.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
57-
//! | [`bigdecimal::BigDecimal`] (v0.4.x) | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
55+
//! | [`bigdecimal::BigDecimal`] | MySql int, uint, floats or bytes parsed using `BigDecimal::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql `DECIMAL` type but it'll be serialized anyway. |
5856
//! | `num_bigint::{BigInt, BigUint}` | MySql int, uint or bytes parsed using `_::parse_bytes`.<br>⚠️ Note that range of this type is greater than supported by MySql integer types but it'll be serialized anyway (as decimal bytes string). |
5957
//!
6058
//! Also crate provides from-row convertion for the following list of types (see `FromRow` trait):
@@ -70,16 +68,13 @@
7068
//!
7169
//! | Feature | Description | Default |
7270
//! | -------------- | ---------------------------------------------------- | ------- |
73-
//! | `bigdecimal02` | Enables `bigdecimal` v0.2.x types support | 🔴 |
74-
//! | `bigdecimal03` | Enables `bigdecimal` v0.3.x types support | 🔴 |
75-
//! | `bigdecimal` | Enables `bigdecimal` v0.4.x types support | 🟢 |
71+
//! | `bigdecimal` | Enables `bigdecimal` >=0.3.x, <0.5.x types support | 🔴 |
7672
//! | `chrono` | Enables `chrono` types support | 🔴 |
77-
//! | `rust_decimal` | Enables `rust_decimal` types support | 🟢 |
78-
//! | `time02` | Enables `time` v0.2.x types support | 🔴 |
79-
//! | `time` | Enables `time` v0.3.x types support | 🟢 |
80-
//! | `frunk` | Enables `FromRow` for `frunk::Hlist!` types | 🟢 |
73+
//! | `rust_decimal` | Enables `rust_decimal` types support | 🔴 |
74+
//! | `time` | Enables `time` v0.3.x types support | 🔴 |
75+
//! | `frunk` | Enables `FromRow` for `frunk::Hlist!` types | 🔴 |
8176
//! | `derive` | Enables [`FromValue` and `FromRow` derive macros][2] | 🟢 |
82-
//! | `binlog` | Binlog-related functionality | 🟢 |
77+
//! | `binlog` | Binlog-related functionality | 🔴 |
8378
//!
8479
//! # Derive Macros
8580
//!
@@ -343,12 +338,6 @@ extern crate test;
343338
#[macro_use]
344339
pub mod bitflags_ext;
345340

346-
#[cfg(feature = "bigdecimal02")]
347-
pub use bigdecimal02;
348-
349-
#[cfg(feature = "bigdecimal03")]
350-
pub use bigdecimal03;
351-
352341
#[cfg(feature = "bigdecimal")]
353342
pub use bigdecimal;
354343

@@ -361,9 +350,6 @@ pub use frunk;
361350
#[cfg(feature = "rust_decimal")]
362351
pub use rust_decimal;
363352

364-
#[cfg(feature = "time02")]
365-
pub use time02;
366-
367353
#[cfg(feature = "time")]
368354
pub use time;
369355

src/value/convert/bigdecimal02.rs

Lines changed: 0 additions & 105 deletions
This file was deleted.

src/value/convert/bigdecimal03.rs

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)