From 3e52430c3314fc48fe81cd00b97769ca15ff9b27 Mon Sep 17 00:00:00 2001 From: liuq19 Date: Thu, 11 Jan 2024 11:40:34 +0800 Subject: [PATCH] feat: support prelude for json traits --- Cargo.lock | 2 +- Cargo.toml | 2 +- fuzz/Cargo.lock | 2 +- src/lib.rs | 2 ++ src/prelude.rs | 7 +++++++ 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 src/prelude.rs diff --git a/Cargo.lock b/Cargo.lock index 514f070..531c8d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -859,7 +859,7 @@ checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "sonic-rs" -version = "0.3.1" +version = "0.3.2" dependencies = [ "arrayref", "bumpalo", diff --git a/Cargo.toml b/Cargo.toml index 040e88e..0bba55e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sonic-rs" -version = "0.3.1" +version = "0.3.2" authors = ["Volo Team "] edition = "2021" description = "Sonic-rs is a fast Rust JSON library based on SIMD" diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 036f642..a44dc78 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -229,7 +229,7 @@ checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "sonic-rs" -version = "0.3.1" +version = "0.3.2" dependencies = [ "arrayref", "bumpalo", diff --git a/src/lib.rs b/src/lib.rs index 09beed6..bc98b4b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,3 +40,5 @@ pub use crate::value::{ from_value, to_value, Array, JsonContainerTrait, JsonType, JsonValueMutTrait, JsonValueTrait, Object, Value, ValueRef, }; + +pub mod prelude; diff --git a/src/prelude.rs b/src/prelude.rs new file mode 100644 index 0000000..e25eee8 --- /dev/null +++ b/src/prelude.rs @@ -0,0 +1,7 @@ +//! Imports the various traits about JSON. `use sonic_rs::prelude::*`` to make the +//! various traits and methods imported if you need. + +pub use crate::{ + serde::JsonNumberTrait, + value::{JsonContainerTrait, JsonValueMutTrait, JsonValueTrait}, +};