From 6bd00767a1079cb45b60e712459997da27ca8f7f Mon Sep 17 00:00:00 2001 From: baoyachi Date: Mon, 22 Apr 2024 01:35:25 +0800 Subject: [PATCH 1/5] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ee0656d..053754a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "duration-str" -version = "0.8.1" +version = "0.8.1-pre" authors = ["baoyachi "] edition = "2021" description = "duration string parser" From 5c5a7ce5dc30e34eed70ca4455ae8e3744521ae7 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Thu, 25 Apr 2024 06:52:03 +0800 Subject: [PATCH 2/5] Fix compile error in specific feature combinations --- src/serde.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/serde.rs b/src/serde.rs index fd482ed..b020b20 100644 --- a/src/serde.rs +++ b/src/serde.rs @@ -1,4 +1,8 @@ -use crate::{parse_chrono, parse_std, parse_time}; +#[cfg(all(feature = "chrono", feature = "serde"))] +use crate::parse_chrono; +#[cfg(all(feature = "time", feature = "serde"))] +use crate::parse_time; +use crate::parse_std; use std::time::Duration; #[cfg(all(feature = "chrono", feature = "serde"))] @@ -160,7 +164,7 @@ mod tests { ); } - #[cfg(feature = "serde")] + #[cfg(all(feature = "serde", feature = "chrono"))] #[test] fn test_deserialize_duration_chrono() { use chrono::Duration; @@ -177,7 +181,7 @@ mod tests { ); } - #[cfg(feature = "serde")] + #[cfg(all(feature = "serde", feature = "chrono"))] #[test] fn test_deserialize_option_duration_chrono() { use chrono::Duration; From 5f6fd255320720bfe6a952b6c1da4f5b01232809 Mon Sep 17 00:00:00 2001 From: baoyachi Date: Thu, 25 Apr 2024 09:44:31 +0800 Subject: [PATCH 3/5] Update serde.rs --- src/serde.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serde.rs b/src/serde.rs index b020b20..628bd7a 100644 --- a/src/serde.rs +++ b/src/serde.rs @@ -1,8 +1,8 @@ #[cfg(all(feature = "chrono", feature = "serde"))] use crate::parse_chrono; +use crate::parse_std; #[cfg(all(feature = "time", feature = "serde"))] use crate::parse_time; -use crate::parse_std; use std::time::Duration; #[cfg(all(feature = "chrono", feature = "serde"))] From 2857b636e09d9648b76353eec6b433b010db88d0 Mon Sep 17 00:00:00 2001 From: baoyachi Date: Thu, 25 Apr 2024 09:44:55 +0800 Subject: [PATCH 4/5] Update Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a8e0b42..bbd5c19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "duration-str" -version = "0.9.0-pre" +version = "0.9.1" authors = ["baoyachi "] edition = "2021" description = "duration string parser" From 4fd7ca372f2e287294c80dd23df2e4563dbac62d Mon Sep 17 00:00:00 2001 From: baoyachi Date: Thu, 25 Apr 2024 09:56:58 +0800 Subject: [PATCH 5/5] Update check.yml --- .github/workflows/check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9511c25..d03687b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -45,6 +45,8 @@ jobs: run: cargo run --example deserialize_duration - name: Run examples with deserialize_duration_chrono run: cargo run --example deserialize_duration_chrono + - name: Run examples with deserialize_duration_time + run: cargo run --example deserialize_duration_time # build on nightly - uses: actions-rs/toolchain@v1 @@ -64,4 +66,4 @@ jobs: - name: Publish shell: bash run: | - cargo publish --token ${{ secrets.CRATES_GITHUB_TOKEN }} \ No newline at end of file + cargo publish --token ${{ secrets.CRATES_GITHUB_TOKEN }}