Unwraps the `Map` inside a `json!({…})` object literal so handlers can mutate payload keys directly instead of guarding `as_object_mut()` calls that cannot fail. Non-object input yields an empty map.
(value: Value)
| 93 | /// mutate payload keys directly instead of guarding `as_object_mut()` calls |
| 94 | /// that cannot fail. Non-object input yields an empty map. |
| 95 | pub(crate) fn json_object(value: Value) -> Map<String, Value> { |
| 96 | match value { |
| 97 | Value::Object(map) => map, |
| 98 | _ => Map::new(), |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | /// Escapes `%`/`_`/`\` for a `LIKE ? ESCAPE '\'` pattern. |
| 103 | pub(crate) fn like_pattern(query: &str) -> String { |
no outgoing calls
no test coverage detected