MCPcopy Create free account
hub / github.com/hashintel/hash / try_single

Function try_single

libs/error-stack/src/sink.rs:492–507  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

490 #[cfg(nightly)]
491 #[test]
492 fn try_single() {
493 fn sink() -> Result<(), Report<[TestError]>> {
494 let mut sink = ReportSink::new();
495
496 sink.append(Report::new(TestError(0)));
497
498 sink?;
499 Ok(())
500 }
501
502 let report = sink().expect_err("should have failed");
503
504 let contexts: BTreeSet<_> = report.current_contexts().collect();
505 assert_eq!(contexts.len(), 1);
506 assert!(contexts.contains(&TestError(0)));
507 }
508
509 #[cfg(nightly)]
510 #[test]

Callers

nothing calls this directly

Calls 3

sinkFunction · 0.85
collectMethod · 0.80
current_contextsMethod · 0.80

Tested by

no test coverage detected