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

Function no_error

libs/error-stack/src/ext/tuple.rs:159–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157
158 #[test]
159 fn no_error() {
160 let result1: Result<i32, Report<TestError>> = Ok(1);
161 let result2: Result<String, Report<TestError>> = Ok("test".to_owned());
162 let result3: Result<bool, Report<TestError>> = Ok(true);
163
164 let combined = (result1, result2, result3).try_collect();
165 let (ok1, ok2, ok3) = combined.expect("should have no error");
166
167 assert_eq!(ok1, 1);
168 assert_eq!(ok2, "test");
169 assert!(ok3);
170 }
171
172 #[test]
173 fn expanded_error() {

Callers

nothing calls this directly

Calls 4

OkInterface · 0.85
try_collectMethod · 0.80
to_ownedMethod · 0.45
expectMethod · 0.45

Tested by

no test coverage detected