Skip to content

Commit

Permalink
Add an example of producing a Null in a json! literal
Browse files Browse the repository at this point in the history
I tried to do this, and while you can piece together the way to do this from the interpolation comment, it's the one piece of direct JSON syntax that isn't immediately obvious.
  • Loading branch information
ndmitchell authored May 18, 2023
1 parent 187f7da commit 0d7b0d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
///
/// ```
/// # use serde_json::json;
/// # use serde_json::Value;
/// #
/// let value = json!({
/// "code": 200,
Expand All @@ -10,7 +11,8 @@
/// "features": [
/// "serde",
/// "json"
/// ]
/// ],
/// "empty": Value::Null
/// }
/// });
/// ```
Expand Down

0 comments on commit 0d7b0d3

Please sign in to comment.