Skip to content

Commit 39809c5

Browse files
committed
Replace a try_fold in rustc_transmute to use ControlFlow instead of Result
1 parent 83f081f commit 39809c5

File tree

1 file changed

+4
-3
lines changed
  • compiler/rustc_transmute/src/layout

1 file changed

+4
-3
lines changed

Diff for: compiler/rustc_transmute/src/layout/tree.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use super::{Byte, Def, Ref};
2+
use std::ops::ControlFlow;
23

34
#[cfg(test)]
45
mod tests;
@@ -90,13 +91,13 @@ where
9091
Tree::unit(),
9192
|elts, elt| {
9293
if elt == Tree::uninhabited() {
93-
Err(Tree::uninhabited())
94+
ControlFlow::Break(Tree::uninhabited())
9495
} else {
95-
Ok(elts.then(elt))
96+
ControlFlow::Continue(elts.then(elt))
9697
}
9798
},
9899
) {
99-
Err(node) | Ok(node) => node,
100+
ControlFlow::Break(node) | ControlFlow::Continue(node) => node,
100101
},
101102
Self::Alt(alts) => alts
102103
.into_iter()

0 commit comments

Comments
 (0)