diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 42df5ee6fb..a85f4d5d8c 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -238,7 +238,7 @@ fn main() -> io::Result<()> { current_block = String::new(); } else if in_roc_block { current_block.push_str(&line); - current_block.push_str("\n"); + current_block.push('\n'); } } diff --git a/crates/compiler/can/src/def.rs b/crates/compiler/can/src/def.rs index b740013e4c..2b3ea55011 100644 --- a/crates/compiler/can/src/def.rs +++ b/crates/compiler/can/src/def.rs @@ -2800,7 +2800,7 @@ pub fn report_unused_imports( } } -fn decl_to_let_or_return<'a>( +fn decl_to_let_or_return( decl: Declaration, loc_ret: Loc, var_store: &mut VarStore, diff --git a/crates/compiler/can/src/desugar.rs b/crates/compiler/can/src/desugar.rs index 653da47b1c..bcedc212a6 100644 --- a/crates/compiler/can/src/desugar.rs +++ b/crates/compiler/can/src/desugar.rs @@ -181,7 +181,7 @@ fn desugar_value_def<'a>( Return(return_expr) => { let desugared_return_expr = &*env.arena.alloc(desugar_expr(env, scope, return_expr)); - Return(&desugared_return_expr) + Return(desugared_return_expr) } } } diff --git a/crates/compiler/can/src/scope.rs b/crates/compiler/can/src/scope.rs index 0119b5fdd5..fe6608f4ff 100644 --- a/crates/compiler/can/src/scope.rs +++ b/crates/compiler/can/src/scope.rs @@ -471,7 +471,7 @@ impl Scope { where F: FnOnce(&mut Scope) -> T, { - let early_returns_snapshot = std::mem::replace(&mut self.early_returns, Vec::new()); + let early_returns_snapshot = std::mem::take(&mut self.early_returns); let result = self.inner_def_scope(f); diff --git a/crates/compiler/fmt/src/expr.rs b/crates/compiler/fmt/src/expr.rs index 29257695cb..74912b5e8b 100644 --- a/crates/compiler/fmt/src/expr.rs +++ b/crates/compiler/fmt/src/expr.rs @@ -457,7 +457,7 @@ impl<'a> Formattable for Expr<'a> { "LowLevelDbg should only exist after desugaring, not during formatting" ), Return(return_value, after_return) => { - fmt_return(buf, return_value, &after_return, parens, newlines, indent); + fmt_return(buf, return_value, after_return, parens, newlines, indent); } If { if_thens: branches,