Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into issue/33
Browse files Browse the repository at this point in the history
  • Loading branch information
baoyachi committed May 10, 2024
2 parents 7aa131e + 4fd7ca3 commit b2afd1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -64,4 +66,4 @@ jobs:
- name: Publish
shell: bash
run: |
cargo publish --token ${{ secrets.CRATES_GITHUB_TOKEN }}
cargo publish --token ${{ secrets.CRATES_GITHUB_TOKEN }}
10 changes: 7 additions & 3 deletions src/serde.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use crate::{parse_chrono, parse_std, parse_time};
#[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 std::time::Duration;

#[cfg(all(feature = "chrono", feature = "serde"))]
Expand Down Expand Up @@ -160,7 +164,7 @@ mod tests {
);
}

#[cfg(feature = "serde")]
#[cfg(all(feature = "serde", feature = "chrono"))]
#[test]
fn test_deserialize_duration_chrono() {
use chrono::Duration;
Expand All @@ -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;
Expand Down

0 comments on commit b2afd1d

Please sign in to comment.