MCPcopy Create free account
hub / github.com/chanced/jsonptr / resolve_error

Function resolve_error

src/diagnostic.rs:256–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

254 feature = "json"
255 ))]
256 fn resolve_error() {
257 let v = serde_json::json!({"foo": {"bar": ["0"]}});
258 let ptr = PointerBuf::parse("/foo/bar/invalid/cannot/reach").unwrap();
259 let report = ptr.resolve(&v).diagnose(ptr).unwrap_err();
260 println!("{:?}", miette::Report::from(report));
261
262 let ptr = PointerBuf::parse("/foo/bar/3/cannot/reach").unwrap();
263 let report = ptr.resolve(&v).diagnose(ptr).unwrap_err();
264 println!("{:?}", miette::Report::from(report));
265 }
266
267 #[test]
268 #[cfg(feature = "miette")]

Callers

nothing calls this directly

Calls 3

parseFunction · 0.85
diagnoseMethod · 0.80
resolveMethod · 0.45

Tested by

no test coverage detected