From fb6f82f521ee5fcf0018570224879aa3f1d79db3 Mon Sep 17 00:00:00 2001 From: yassun7010 Date: Sat, 2 Mar 2024 22:18:42 +0900 Subject: [PATCH 1/2] fix: remove json feature. it's default. --- serde_valid/Cargo.toml | 3 +-- serde_valid/src/features.rs | 3 --- serde_valid/src/{features => }/json.rs | 0 serde_valid/src/{features => }/json/from_json_reader.rs | 0 serde_valid/src/{features => }/json/from_json_slice.rs | 0 serde_valid/src/{features => }/json/from_json_str.rs | 0 serde_valid/src/{features => }/json/from_json_value.rs | 0 serde_valid/src/{features => }/json/to_json_string.rs | 0 serde_valid/src/{features => }/json/to_json_value.rs | 0 serde_valid/src/{features => }/json/to_json_writer.rs | 0 serde_valid/src/lib.rs | 1 + 11 files changed, 2 insertions(+), 5 deletions(-) rename serde_valid/src/{features => }/json.rs (100%) rename serde_valid/src/{features => }/json/from_json_reader.rs (100%) rename serde_valid/src/{features => }/json/from_json_slice.rs (100%) rename serde_valid/src/{features => }/json/from_json_str.rs (100%) rename serde_valid/src/{features => }/json/from_json_value.rs (100%) rename serde_valid/src/{features => }/json/to_json_string.rs (100%) rename serde_valid/src/{features => }/json/to_json_value.rs (100%) rename serde_valid/src/{features => }/json/to_json_writer.rs (100%) diff --git a/serde_valid/Cargo.toml b/serde_valid/Cargo.toml index 3ecaf158..22f454e2 100644 --- a/serde_valid/Cargo.toml +++ b/serde_valid/Cargo.toml @@ -34,8 +34,7 @@ intl-memoizer = "0.5" unic-langid = "0.9" [features] -default = ["i128", "json"] -json = ["serde_json"] +default = ["i128"] toml = ["serde_toml"] yaml = ["serde_yaml"] i128 = ["num-traits/i128", "indexmap/std", "serde_valid_literal/i128"] diff --git a/serde_valid/src/features.rs b/serde_valid/src/features.rs index 9039e3cb..928b4a5e 100644 --- a/serde_valid/src/features.rs +++ b/serde_valid/src/features.rs @@ -4,9 +4,6 @@ pub mod flatten; #[cfg(feature = "fluent")] pub mod fluent; -#[cfg(feature = "json")] -pub mod json; - #[cfg(feature = "toml")] pub mod toml; diff --git a/serde_valid/src/features/json.rs b/serde_valid/src/json.rs similarity index 100% rename from serde_valid/src/features/json.rs rename to serde_valid/src/json.rs diff --git a/serde_valid/src/features/json/from_json_reader.rs b/serde_valid/src/json/from_json_reader.rs similarity index 100% rename from serde_valid/src/features/json/from_json_reader.rs rename to serde_valid/src/json/from_json_reader.rs diff --git a/serde_valid/src/features/json/from_json_slice.rs b/serde_valid/src/json/from_json_slice.rs similarity index 100% rename from serde_valid/src/features/json/from_json_slice.rs rename to serde_valid/src/json/from_json_slice.rs diff --git a/serde_valid/src/features/json/from_json_str.rs b/serde_valid/src/json/from_json_str.rs similarity index 100% rename from serde_valid/src/features/json/from_json_str.rs rename to serde_valid/src/json/from_json_str.rs diff --git a/serde_valid/src/features/json/from_json_value.rs b/serde_valid/src/json/from_json_value.rs similarity index 100% rename from serde_valid/src/features/json/from_json_value.rs rename to serde_valid/src/json/from_json_value.rs diff --git a/serde_valid/src/features/json/to_json_string.rs b/serde_valid/src/json/to_json_string.rs similarity index 100% rename from serde_valid/src/features/json/to_json_string.rs rename to serde_valid/src/json/to_json_string.rs diff --git a/serde_valid/src/features/json/to_json_value.rs b/serde_valid/src/json/to_json_value.rs similarity index 100% rename from serde_valid/src/features/json/to_json_value.rs rename to serde_valid/src/json/to_json_value.rs diff --git a/serde_valid/src/features/json/to_json_writer.rs b/serde_valid/src/json/to_json_writer.rs similarity index 100% rename from serde_valid/src/features/json/to_json_writer.rs rename to serde_valid/src/json/to_json_writer.rs diff --git a/serde_valid/src/lib.rs b/serde_valid/src/lib.rs index cc8e53a2..46df01cd 100644 --- a/serde_valid/src/lib.rs +++ b/serde_valid/src/lib.rs @@ -578,6 +578,7 @@ pub mod error; mod features; +pub mod json; mod traits; pub mod validation; From 66b27a4af081be0ed5bee8793bb35c7d009da371 Mon Sep 17 00:00:00 2001 From: yassun7010 Date: Sat, 2 Mar 2024 22:21:14 +0900 Subject: [PATCH 2/2] fix: feature. --- serde_valid/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serde_valid/Cargo.toml b/serde_valid/Cargo.toml index 22f454e2..82771a58 100644 --- a/serde_valid/Cargo.toml +++ b/serde_valid/Cargo.toml @@ -21,7 +21,7 @@ once_cell = "^1.7" paste = { workspace = true } regex = { workspace = true } serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, optional = true } +serde_json = { workspace = true } serde_toml = { package = "toml", version = "^0.8", optional = true } serde_valid_derive = { version = "0.18.0", path = "../serde_valid_derive" } serde_valid_literal = { version = "0.18.0", path = "../serde_valid_literal" }