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

Function try_collect_no_errors

libs/error-stack/src/ext/iter.rs:259–266  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

257
258 #[test]
259 fn try_collect_no_errors() {
260 let iter = (0..5).map(Result::<_, Report<CustomError>>::Ok);
261
262 let result: Result<Vec<_>, Report<[CustomError]>> = iter.try_collect_reports();
263 let values = result.expect("should have succeeded");
264
265 assert_eq!(values, [0, 1, 2, 3, 4]);
266 }
267
268 #[test]
269 fn try_collect_multiple_errors_expanded() {

Callers

nothing calls this directly

Calls 3

mapMethod · 0.45
try_collect_reportsMethod · 0.45
expectMethod · 0.45

Tested by

no test coverage detected