Remove unstable Result::into_ok_or_err
This commit is contained in:
parent
9c20b2a8cc
commit
83f081fc01
6 changed files with 8 additions and 59 deletions
|
@ -86,17 +86,18 @@ where
|
|||
F: Fn(D) -> bool,
|
||||
{
|
||||
match self {
|
||||
Self::Seq(elts) => elts
|
||||
.into_iter()
|
||||
.map(|elt| elt.prune(f))
|
||||
.try_fold(Tree::unit(), |elts, elt| {
|
||||
Self::Seq(elts) => match elts.into_iter().map(|elt| elt.prune(f)).try_fold(
|
||||
Tree::unit(),
|
||||
|elts, elt| {
|
||||
if elt == Tree::uninhabited() {
|
||||
Err(Tree::uninhabited())
|
||||
} else {
|
||||
Ok(elts.then(elt))
|
||||
}
|
||||
})
|
||||
.into_ok_or_err(),
|
||||
},
|
||||
) {
|
||||
Err(node) | Ok(node) => node,
|
||||
},
|
||||
Self::Alt(alts) => alts
|
||||
.into_iter()
|
||||
.map(|alt| alt.prune(f))
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
#![feature(
|
||||
alloc_layout_extra,
|
||||
control_flow_enum,
|
||||
decl_macro,
|
||||
iterator_try_reduce,
|
||||
never_type,
|
||||
result_into_ok_or_err
|
||||
)]
|
||||
#![feature(alloc_layout_extra, control_flow_enum, decl_macro, iterator_try_reduce, never_type)]
|
||||
#![allow(dead_code, unused_variables)]
|
||||
|
||||
#[macro_use]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue