Skip to content

Commit

Permalink
add support for jiff
Browse files Browse the repository at this point in the history
  • Loading branch information
laptou committed Jan 12, 2025
1 parent 60ffc27 commit 8960b58
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion specta/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "specta"
description = "Easily export your Rust types to other languages"
version = "2.0.0-rc.21"
version = "2.0.0-rc.22"
authors = ["Oscar Beaumont <[email protected]>"]
edition = "2021"
license = "MIT"
Expand Down 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 8960b58

Please sign in to comment.