mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
fmt and clippy fixes
This commit is contained in:
parent
cc10df6db9
commit
e74501981e
6 changed files with 6 additions and 19 deletions
|
@ -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))),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
extern crate bumpalo;
|
||||
|
||||
use self::bumpalo::Bump;
|
||||
use roc_can::desugar;
|
||||
use roc_can::env::Env;
|
||||
use roc_can::expr::Output;
|
||||
use roc_can::expr::{canonicalize_expr, Expr};
|
||||
use roc_can::desugar;
|
||||
use roc_can::scope::Scope;
|
||||
use roc_collections::all::MutMap;
|
||||
use roc_module::symbol::{IdentIds, Interns, ModuleId, ModuleIds, Symbol};
|
||||
|
|
|
@ -3,10 +3,10 @@ extern crate bumpalo;
|
|||
use self::bumpalo::Bump;
|
||||
use roc_can::abilities::AbilitiesStore;
|
||||
use roc_can::constraint::{Constraint, Constraints};
|
||||
use roc_can::desugar;
|
||||
use roc_can::env::Env;
|
||||
use roc_can::expected::Expected;
|
||||
use roc_can::expr::{canonicalize_expr, Expr, Output, PendingDerives};
|
||||
use roc_can::desugar;
|
||||
use roc_can::scope::Scope;
|
||||
use roc_collections::all::{ImMap, MutMap, SendSet};
|
||||
use roc_constrain::expr::constrain_expr;
|
||||
|
|
|
@ -494,7 +494,6 @@ impl<'a> Defs<'a> {
|
|||
})
|
||||
}
|
||||
|
||||
// TODO QUESTION DO WE NEED TO REMOVE ANYTHING FROM SPACES FIELD?
|
||||
pub fn remove_value_def(&mut self, index: usize) {
|
||||
match self
|
||||
.tags
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue