diff --git a/compiler/can/src/pattern.rs b/compiler/can/src/pattern.rs index c5cd46b202..00b06ee875 100644 --- a/compiler/can/src/pattern.rs +++ b/compiler/can/src/pattern.rs @@ -361,7 +361,7 @@ pub fn canonicalize_pattern<'a>( // If we encountered an erroneous pattern (e.g. one with shadowing), // use the resulting RuntimeError. Otherwise, return a successful record destructure. - opt_erroneous.unwrap_or_else(|| Pattern::RecordDestructure { + opt_erroneous.unwrap_or(Pattern::RecordDestructure { whole_var, ext_var, destructs, diff --git a/compiler/load/src/docs.rs b/compiler/load/src/docs.rs index cd403ecb37..b52d655cf4 100644 --- a/compiler/load/src/docs.rs +++ b/compiler/load/src/docs.rs @@ -137,7 +137,7 @@ fn comments_or_new_lines_to_docs<'a>( match comment_or_new_line { DocComment(doc_str) => { docs.push_str(doc_str); - docs.push_str("\n"); + docs.push('\n'); } Newline | LineComment(_) => {} } diff --git a/compiler/mono/src/ir.rs b/compiler/mono/src/ir.rs index 0feb855f47..689eae51f0 100644 --- a/compiler/mono/src/ir.rs +++ b/compiler/mono/src/ir.rs @@ -1263,7 +1263,7 @@ fn patterns_to_when<'a>( // Even if the body was Ok, replace it with this Err. // If it was already an Err, leave it at that Err, so the first // RuntimeError we encountered remains the first. - body = body.and_then(|_| { + body = body.and({ Err(Located { region: pattern.region, value, diff --git a/compiler/parse/src/type_annotation.rs b/compiler/parse/src/type_annotation.rs index a1946bea00..7195b9862d 100644 --- a/compiler/parse/src/type_annotation.rs +++ b/compiler/parse/src/type_annotation.rs @@ -342,7 +342,7 @@ fn parse_concrete_type<'a>( // // If we made it this far and don't have a next_char, then necessarily // we have consumed a '.' char previously. - return malformed(next_char.or_else(|| Some('.')), arena, state, parts); + return malformed(next_char.or(Some('.')), arena, state, parts); } if part_buf.is_empty() { diff --git a/roc_std/src/alloca.rs b/roc_std/src/alloca.rs index 1fa9c26525..ef30a59b44 100644 --- a/roc_std/src/alloca.rs +++ b/roc_std/src/alloca.rs @@ -6,7 +6,7 @@ use libc::{c_void, size_t}; #[link(name = "alloca")] extern "C" { - #[no_mangle] + #[allow(dead_code)] fn c_alloca(_: size_t) -> *mut c_void; }