Skip to content

Commit

Permalink
Tweak no-std wording to show Cargo.toml snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 23, 2020
1 parent 67dfe59 commit dca5037
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,14 @@ issues](https://github.com/serde-rs/json/issues/new) as well.

## No-std support

It is possible to opt out of the Rust standard library by enabling the `alloc`
feature (and disabling the default `std` one). This is supported on Rust 1.36+.
As long as there is a memory allocator, it is possible to use serde_json without
the rest of the Rust standard library. This is supported on Rust 1.36+. Disable
the default "std" feature and enable the "alloc" feature:

```toml
[dependencies]
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
```

For JSON support in Serde without a memory allocator, please see the
[`serde-json-core`] crate.
Expand Down

0 comments on commit dca5037

Please sign in to comment.