Disable clippy rule for manual_map

This commit is contained in:
Richard Feldman 2021-05-07 07:57:20 -04:00
parent 95da2a246d
commit ab8cc95c2b
3 changed files with 19 additions and 10 deletions

View file

@ -1,3 +1,5 @@
#![allow(clippy::manual_map)]
use bumpalo::collections::Vec;
use bumpalo::Bump;
use roc_module::ident::ModuleName;
@ -283,10 +285,11 @@ pub fn desugar_expr<'a>(arena: &'a Bump, loc_expr: &'a Located<Expr<'a>>) -> &'a
let mut alternatives = Vec::with_capacity_in(branch.patterns.len(), arena);
alternatives.extend(branch.patterns.iter().copied());
let desugared_guard = branch
.guard
.as_ref()
.map(|guard| *desugar_expr(arena, guard));
let desugared_guard = if let Some(guard) = &branch.guard {
Some(*desugar_expr(arena, guard))
} else {
None
};
let alternatives = alternatives.into_bump_slice();