mirror of
https://github.com/serde-rs/json.git
synced 2026-03-14 10:17:42 +00:00
This is a way to avoid instantiating all the Visitor methods on every Visitor that is used with serde_json. If the Deserialize impl hints that a boolean is required by invoking deserialize_bool, we don't also need to instantiate its visit_u64 and visit_i64 and visit_f64 and visit_str and visit_borrowed_str and visit_unit and visit_seq and visit_map methods if the input contains some other type. Instead we render the invalid_type error in a central place in the serde_json Deserializer that is instantiated just once. Improves compile time of json-benchmark by 30%.