Skip to content

Commit

Permalink
feat: implement compact_str
Browse files Browse the repository at this point in the history
  • Loading branch information
nerodono committed Oct 26, 2024
1 parent a479e6c commit 92ad6c8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ smallvec1 = { version = "1.0", default-features = false, optional = true, packag
smol_str02 = { version = "0.2.1", default-features = false, optional = true, package = "smol_str" }
url2 = { version = "2.0", default-features = false, optional = true, package = "url" }
uuid1 = { version = "1.0", default-features = false, optional = true, package = "uuid" }
compact_str = { version = "0.8.0", optional = true }

[dev-dependencies]
pretty_assertions = "1.2.1"
Expand Down Expand Up @@ -78,6 +79,7 @@ raw_value = ["serde_json/raw_value"]

# For internal/CI use only
_ui_test = []
compact_str = ["dep:compact_str"]

[[test]]
name = "ui"
Expand Down
3 changes: 3 additions & 0 deletions schemars/src/json_schema_impls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ forward_impl!((<A: smallvec1::Array> crate::JsonSchema for smallvec1::SmallVec<A
#[cfg(feature = "smol_str02")]
forward_impl!(smol_str02::SmolStr => alloc::string::String);

#[cfg(feature = "compact_str")]
forward_impl!(compact_str::CompactString => alloc::string::String);

#[cfg(feature = "url2")]
mod url2;

Expand Down

0 comments on commit 92ad6c8

Please sign in to comment.