Split `reply.evidence.figure` into (`reply`, `["evidence", "figure"]`). Errors with a hint if the root is unknown.
(path: &str)
| 51 | /// Split `reply.evidence.figure` into (`reply`, `["evidence", "figure"]`). |
| 52 | /// Errors with a hint if the root is unknown. |
| 53 | fn split_root(path: &str) -> Result<(&'static str, Vec<&str>)> { |
| 54 | let mut parts = path.split('.'); |
| 55 | let root_input = parts.next().unwrap_or(""); |
| 56 | let root = ROOTS |
| 57 | .iter() |
| 58 | .find(|r| **r == root_input) |
| 59 | .copied() |
| 60 | .ok_or_else(|| { |
| 61 | anyhow!( |
| 62 | "unknown root `{}`; expected one of: {}", |
| 63 | root_input, |
| 64 | ROOTS.join(", ") |
| 65 | ) |
| 66 | })?; |
| 67 | Ok((root, parts.collect())) |
| 68 | } |
| 69 | |
| 70 | /// Build the root JsonSchema for `reply` / `state` / `trace` / `run_detail`. |
| 71 | fn root_schema_for(root: &str) -> RootSchema { |
no outgoing calls
no test coverage detected
searching dependent graphs…