Skip to content

Make getopts optional #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "jsonxf"
version = "1.1.1"
edition = "2015"
version = "1.1.2"
authors = ["pete gamache <[email protected]>"]
description = "A fast JSON pretty-printer and minimizer."
homepage = "https://github.com/gamache/jsonxf"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In your `Cargo.toml`:

```
[dependencies]
jsonxf = "1.1"
jsonxf = { version = "1.1.2", default-features = false }
```

In your code:
Expand All @@ -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}");
```


Expand Down