From 27055849b612b0b6ddad5a4d582e8862ab7afc6d Mon Sep 17 00:00:00 2001 From: CookiePieWw Date: Thu, 29 Aug 2024 19:49:28 +0800 Subject: [PATCH 1/2] feat: add feature control for order of objects --- Cargo.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3ecefa6..5a1d072 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,9 +33,7 @@ nom = "7.1.3" ordered-float = { version = "4.2", default-features = false } rand = { version = "0.8.5", features = ["small_rng"] } ryu = "1.0" -serde_json = { version = "1.0", default-features = false, features = [ - "preserve_order", -] } +serde_json = { version = "1.0", default-features = false, features = ["std"] } [dev-dependencies] goldenfile = "1.7" @@ -45,6 +43,10 @@ simd-json = "0.13.10" mockalloc = "0.1.2" criterion = "0.5.1" +[features] +default = [] +preserve_order = ["serde_json/preserve_order"] + [[bench]] name = "parser" harness = false From d0166c130fce903bf6c58643417a3173a6172d31 Mon Sep 17 00:00:00 2001 From: CookiePieWw Date: Fri, 30 Aug 2024 14:48:59 +0800 Subject: [PATCH 2/2] refactor: keep default feature --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5a1d072..07018c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,8 +44,7 @@ mockalloc = "0.1.2" criterion = "0.5.1" [features] -default = [] -preserve_order = ["serde_json/preserve_order"] +default = ["serde_json/preserve_order"] [[bench]] name = "parser"