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

Function iter_mut_break

libs/error-stack/tests/test_iter.rs:117–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115
116#[test]
117fn iter_mut_break() {
118 let mut report = build();
119
120 let mut chars = Vec::new();
121 let flow = report.frames_mut(|frame| {
122 if let Some(ch) = frame.downcast_ref::<Char>() {
123 chars.push(ch.0);
124 if ch.0 == 'D' {
125 return ControlFlow::Break(());
126 }
127 }
128 ControlFlow::Continue(())
129 });
130 assert!(flow.is_break());
131 assert_eq!(chars, ['A', 'B', 'C', 'D']);
132}

Callers

nothing calls this directly

Calls 3

frames_mutMethod · 0.80
buildFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected