MCPcopy Create free account
hub / github.com/elastic/devfiler / parse_embedded_spec

Function parse_embedded_spec

src/storage/errorspec.rs:46–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44));
45
46fn parse_embedded_spec() -> (bool, HashMap<u64, ErrorSpec>) {
47 match serde_json::from_str::<Vec<ErrorSpec>>(&ERROR_JSON) {
48 Ok(x) => (true, x.into_iter().map(|x| (x.id, x)).collect()),
49 Err(e) => {
50 tracing::error!("Failed to parse embedded `errors.json`: {e:?}");
51 return (false, HashMap::new());
52 }
53 }
54}
55
56lazy_static! {
57 static ref SPECS: (bool, HashMap<u64, ErrorSpec>) = parse_embedded_spec();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected