fmt and clippy fixes

This commit is contained in:
Luke Boswell 2024-03-20 12:31:04 +11:00
parent cc10df6db9
commit e74501981e
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
6 changed files with 6 additions and 19 deletions

View file

@ -145,9 +145,6 @@ pub fn desugar_defs_node_values<'a>(
fn desugar_defs_node_suffixed<'a>(
arena: &'a Bump,
src: &'a str,
line_info: &mut Option<LineInfo>,
module_path: &str,
loc_expr: &'a Loc<Expr<'a>>,
) -> &'a Loc<Expr<'a>> {
match loc_expr.value {
@ -223,9 +220,6 @@ fn desugar_defs_node_suffixed<'a>(
// Recurse using new Defs to get new expression
let new_loc_expr = desugar_defs_node_suffixed(
arena,
src,
line_info,
module_path,
arena.alloc(Loc::at(
loc_expr.region,
Defs(arena.alloc(copied_defs), loc_ret),
@ -269,12 +263,9 @@ fn desugar_defs_node_suffixed<'a>(
// If there are no defs after, then just use loc_ret as we dont need a Defs node
let defs_after_suffixed_desugared = {
if after.len() > 0 {
if !after.is_empty() {
desugar_defs_node_suffixed(
arena,
src,
line_info,
module_path,
arena.alloc(Loc::at(
loc_expr.region,
Defs(arena.alloc(after), loc_ret),
@ -590,9 +581,6 @@ pub fn desugar_expr<'a>(
// Desugar any Suffixed nodes
desugar_defs_node_suffixed(
arena,
src,
line_info,
module_path,
arena.alloc(Loc::at(loc_expr.region, Defs(arena.alloc(defs), loc_ret))),
)
}

View file

@ -1441,12 +1441,12 @@ pub fn canonicalize_expr<'a>(
bad_expr
);
}
bad_expr @ ast::Expr::Suffixed(_) => {
bad_expr @ ast::Expr::Suffixed(_) => {
internal_error!(
"A suffixed expression did not get desugared somehow: {:#?}",
bad_expr
);
},
}
};
// At the end, diff used_idents and defined_idents to see which were unused.

View file

@ -13,6 +13,7 @@ pub mod constraint;
pub mod copy;
pub mod def;
mod derive;
pub mod desugar;
pub mod effect_module;
pub mod env;
pub mod exhaustive;
@ -20,7 +21,6 @@ pub mod expected;
pub mod expr;
pub mod module;
pub mod num;
pub mod desugar;
pub mod pattern;
pub mod procedure;
pub mod scope;