Skip to content

Commit

Permalink
Merge pull request #307 from laptou/feat/jiff
Browse files Browse the repository at this point in the history
add support for `jiff`
  • Loading branch information
oscartbeaumont authored Jan 13, 2025
2 parents 42ca9e8 + 8960b58 commit 5758221
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions specta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ ulid = ["dep:ulid"]
chrono = ["dep:chrono"]
## [time](https://docs.rs/time) crate
time = ["dep:time"]
# [jiff](https://docs.rs/jiff) crate
jiff = ["dep:jiff"]
## [bigdecimal](https://docs.rs/bigdecimal) crate
bigdecimal = ["dep:bigdecimal"]
## [rust_decimal](https://docs.rs/rust_decimal) crate
Expand Down Expand Up @@ -118,6 +120,7 @@ url = { version = "2.5.2", optional = true, default-features = false }
either = { version = "1.13.0", optional = true, default-features = false }
bevy_ecs = { version = "0.14.0", optional = true, default-features = false }
bevy_input = { version = "0.14.0", optional = true, default-features = false }
jiff = { version = "0.1", optional = true, default-features = false }

[dev-dependencies]
serde = { version = "1.0.204", features = ["derive"] } # TODO: Can we remove this?
1 change: 1 addition & 0 deletions specta/src/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ External types
- `uuid` - [uuid](https://docs.rs/uuid) crate
- `chrono` - [chrono](https://docs.rs/chrono) crate
- `time` - [time](https://docs.rs/time) crate
- `jiff` - [jiff](https://docs.rs/jiff) crate
- `bigdecimal` - [bigdecimal](https://docs.rs/bigdecimal) crate
- `rust_decimal` - [rust_decimal](https://docs.rs/rust_decimal) crate
- `indexmap` - [indexmap](https://docs.rs/indexmap) crate
Expand Down
11 changes: 11 additions & 0 deletions specta/src/type/legacy_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,17 @@ impl_as!(
time::Weekday as String
);

#[cfg(feature = "jiff")]
impl_as!(
jiff::Timestamp as String
jiff::Zoned as String
jiff::Span as String
jiff::civil::Date as String
jiff::civil::Time as String
jiff::civil::DateTime as String
jiff::tz::TimeZone as String
);

#[cfg(feature = "bigdecimal")]
impl_as!(bigdecimal::BigDecimal as String);

Expand Down

0 comments on commit 5758221

Please sign in to comment.