From ac3af15e2c40db71a2c85bc5ff6282ba6907356e Mon Sep 17 00:00:00 2001 From: zjp Date: Fri, 11 Oct 2024 20:42:20 +0800 Subject: [PATCH 1/4] make getopts optional but enabled by default also update dependencies; explicit 2018 edition; --- Cargo.lock | 10 ++++++---- Cargo.toml | 8 ++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6eed779..929d6eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "getopts" version = "0.2.21" @@ -19,12 +21,12 @@ dependencies = [ [[package]] name = "memchr" -version = "2.3.4" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "unicode-width" -version = "0.1.7" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" diff --git a/Cargo.toml b/Cargo.toml index 58b85ee..f76e348 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "jsonxf" +edition = "2018" version = "1.1.1" authors = ["pete gamache "] description = "A fast JSON pretty-printer and minimizer." @@ -10,8 +11,11 @@ categories = ["encoding", "rendering", "text-processing", "value-formatting"] license = "MIT" [dependencies] -getopts = "0.2" -memchr = "2.3.4" +getopts = { version = "0.2", optional = true } +memchr = "2.7.4" + +[features] +default = ["dep:getopts"] [lib] name = "jsonxf" From e1e35294f2cbde6850d01603a8c295825472e562 Mon Sep 17 00:00:00 2001 From: zjp Date: Fri, 11 Oct 2024 20:48:30 +0800 Subject: [PATCH 2/4] bump to v0.1.2; update library usage in README --- Cargo.toml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f76e348..b4052bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "jsonxf" edition = "2018" -version = "1.1.1" +version = "1.1.2" authors = ["pete gamache "] description = "A fast JSON pretty-printer and minimizer." homepage = "https://github.com/gamache/jsonxf" diff --git a/README.md b/README.md index 04de4af..974e4c8 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ In your `Cargo.toml`: ``` [dependencies] -jsonxf = "1.1" +jsonxf = { version = "1.1.2", default-features = false } ``` In your code: @@ -50,7 +50,7 @@ In your code: extern crate jsonxf; let ugly_json = "{\"hello\":\"world\"}"; let pretty_json = jsonxf::pretty_print(ugly_json).unwrap(); -assert_eq!(pretty_json, "{\n \"hello\": \"world\"\n}\n"); +assert_eq!(pretty_json, "{\n \"hello\": \"world\"\n}"); ``` From dee19fa556443bc85a4e0a5db3213c5baa7d2847 Mon Sep 17 00:00:00 2001 From: zjp Date: Fri, 11 Oct 2024 20:53:41 +0800 Subject: [PATCH 3/4] edition="2021"; update Cargo.lock --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 929d6eb..314300d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,7 +13,7 @@ dependencies = [ [[package]] name = "jsonxf" -version = "1.1.1" +version = "1.1.2" dependencies = [ "getopts", "memchr", diff --git a/Cargo.toml b/Cargo.toml index b4052bf..29ade50 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jsonxf" -edition = "2018" +edition = "2021" version = "1.1.2" authors = ["pete gamache "] description = "A fast JSON pretty-printer and minimizer." From 5bab5219792422f905fdfc934e9d3346fc4b3cf6 Mon Sep 17 00:00:00 2001 From: zjp Date: Sat, 12 Oct 2024 20:30:59 +0800 Subject: [PATCH 4/4] chore: set edition back to 2015 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 29ade50..e791fca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jsonxf" -edition = "2021" +edition = "2015" version = "1.1.2" authors = ["pete gamache "] description = "A fast JSON pretty-printer and minimizer."