Skip to content

Commit c6d2059

Browse files
committed
JSON now supports no-std
1 parent 1856343 commit c6d2059

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

_src/no-std.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ graph. That means if any other crate you depend on has not opted out of Serde's
1515
default features, you will build Serde with the std feature enabled whether or
1616
not your direct dependency on Serde has `default-features = false`.
1717

18-
In particular, a dependency on `serde_json` always needs Serde built with std.
19-
If you need JSON support without a standard library, please use
20-
[`serde-json-core`] instead of `serde_json`.
18+
For example, if you are using `serde_json`, its equivalent enabled-by-default
19+
`"std"` would also need to be disabled.
2120

22-
[`serde-json-core`]: https://crates.io/crates/serde-json-core
21+
```toml
22+
[dependencies]
23+
serde = { version = "1.0", default-features = false }
24+
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
25+
```
2326

2427
### Derive
2528

0 commit comments

Comments
 (0)