remove unused Result wrapper

This commit is contained in:
Folkert 2022-05-08 17:03:08 +02:00
parent c93cfd0993
commit d5b010cb13
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C
2 changed files with 12 additions and 18 deletions

View File

@ -757,7 +757,7 @@ pub(crate) fn sort_can_defs(
env: &mut Env<'_>,
defs: CanDefs,
mut output: Output,
) -> (Result<Vec<Declaration>, RuntimeError>, Output) {
) -> (Vec<Declaration>, Output) {
let CanDefs {
mut defs,
def_ordering,
@ -861,7 +861,7 @@ pub(crate) fn sort_can_defs(
}
}
(Ok(declarations), output)
(declarations, output)
}
fn mark_def_recursive(mut def: Def) -> Def {
@ -1270,23 +1270,18 @@ pub fn can_defs_with_return<'a>(
}
}
let (can_defs, output) = sort_can_defs(env, unsorted, output);
let (declarations, output) = sort_can_defs(env, unsorted, output);
match can_defs {
Ok(decls) => {
let mut loc_expr: Loc<Expr> = ret_expr;
let mut loc_expr: Loc<Expr> = ret_expr;
for declaration in decls.into_iter().rev() {
loc_expr = Loc {
region: Region::zero(),
value: decl_to_let(var_store, declaration, loc_expr),
};
}
(loc_expr.value, output)
}
Err(err) => (RuntimeError(err), output),
for declaration in declarations.into_iter().rev() {
loc_expr = Loc {
region: Region::zero(),
value: decl_to_let(var_store, declaration, loc_expr),
};
}
(loc_expr.value, output)
}
fn decl_to_let(var_store: &mut VarStore, decl: Declaration, loc_ret: Loc<Expr>) -> Expr {

View File

@ -352,7 +352,7 @@ pub fn canonicalize_module_defs<'a>(
};
match sort_can_defs(&mut env, defs, new_output) {
(Ok(mut declarations), mut output) => {
(mut declarations, mut output) => {
use crate::def::Declaration::*;
let symbols_from_requires = symbols_from_requires
@ -582,7 +582,6 @@ pub fn canonicalize_module_defs<'a>(
Ok(output)
}
(Err(runtime_error), _) => Err(runtime_error),
}
}