Skip to content

Commit f0ad233

Browse files
committed
Support im 15.1
1 parent 5268080 commit f0ad233

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

schemars/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ bytes = { version = "1.0", optional = true }
3131
rust_decimal = { version = "1", default-features = false, optional = true }
3232
bigdecimal = { version = "0.3", default-features = false, optional = true }
3333
enumset = { version = "1.0", optional = true }
34+
im = { version = "15.1.0", optional = true }
3435

3536
[dev-dependencies]
3637
pretty_assertions = "1.2.1"

schemars/src/json_schema_impls/im.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use crate::gen::SchemaGenerator;
2+
use crate::schema::*;
3+
use crate::JsonSchema;
4+
use im;
5+
6+
forward_impl!((<T: JsonSchema> JsonSchema for im::HashSet<T>) => std::collections::HashSet<T>);
7+
forward_impl!((<K, V: JsonSchema> JsonSchema for im::HashMap<K, V>) => std::collections::HashMap<K, V>);
8+
forward_impl!((<T: JsonSchema> JsonSchema for im::OrdSet<T>) => std::collections::HashSet<T>);
9+
forward_impl!((<K, V: JsonSchema> JsonSchema for im::OrdMap<K, V>) => std::collections::HashMap<K, V>);
10+
forward_impl!((<T: JsonSchema> JsonSchema for im::Vector<T>) => std::vec::Vec<T>);

schemars/src/json_schema_impls/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ mod either;
5454
#[cfg(feature = "enumset")]
5555
mod enumset;
5656
mod ffi;
57+
#[cfg(feature = "im")]
58+
mod im;
5759
#[cfg(feature = "indexmap")]
5860
mod indexmap;
5961
mod maps;

0 commit comments

Comments
 (0)