Skip to content

Commit 92ad6c8

Browse files
committed
feat: implement compact_str
1 parent a479e6c commit 92ad6c8

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

Cargo.lock

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schemars/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ smallvec1 = { version = "1.0", default-features = false, optional = true, packag
3232
smol_str02 = { version = "0.2.1", default-features = false, optional = true, package = "smol_str" }
3333
url2 = { version = "2.0", default-features = false, optional = true, package = "url" }
3434
uuid1 = { version = "1.0", default-features = false, optional = true, package = "uuid" }
35+
compact_str = { version = "0.8.0", optional = true }
3536

3637
[dev-dependencies]
3738
pretty_assertions = "1.2.1"
@@ -78,6 +79,7 @@ raw_value = ["serde_json/raw_value"]
7879

7980
# For internal/CI use only
8081
_ui_test = []
82+
compact_str = ["dep:compact_str"]
8183

8284
[[test]]
8385
name = "ui"

schemars/src/json_schema_impls/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ forward_impl!((<A: smallvec1::Array> crate::JsonSchema for smallvec1::SmallVec<A
8383
#[cfg(feature = "smol_str02")]
8484
forward_impl!(smol_str02::SmolStr => alloc::string::String);
8585

86+
#[cfg(feature = "compact_str")]
87+
forward_impl!(compact_str::CompactString => alloc::string::String);
88+
8689
#[cfg(feature = "url2")]
8790
mod url2;
8891

0 commit comments

Comments
 (0)