Expand description
JSON object construction that does not go through serde_json::json!.
serde_json::json! expands to Result::unwrap internally, and this repo
bans unwrap via .clippy.toml disallowed-methods (GH-41). The ban fired on
the pv command surface only after that surface moved from main.rs into
lib.rs — the diagnostics were real the whole time, just charged to a bin
target nothing linted.
The usual fix elsewhere in this workspace is a local
#[derive(serde::Serialize)] struct (see
aprender-qa-cli/src/main_tickets_and_parity.rs::save_tool_results_json_or_exit).
aprender-contracts-cli depends on serde_json but not on serde itself,
so it builds the serde_json::Map directly instead. That is the same
representation json! produces — identical keys, identical key ordering
(Map is the one canonical map type either way), identical nesting — with
no unwrap anywhere.
Functions§
- obj
- Build a JSON object from an ordered list of
(key, value)pairs.