mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
clippy
This commit is contained in:
parent
a7b843743d
commit
dc96e194bd
3 changed files with 7 additions and 4 deletions
|
@ -2161,13 +2161,13 @@ impl<'a> LowLevelCall<'a> {
|
|||
|
||||
// Empty record is always equal to empty record.
|
||||
// There are no runtime arguments to check, so just emit true or false.
|
||||
LayoutRepr::Struct(field_layouts) if field_layouts.is_empty() => {
|
||||
LayoutRepr::Struct([]) => {
|
||||
backend.code_builder.i32_const(!invert_result as i32);
|
||||
}
|
||||
|
||||
// Void is always equal to void. This is the type for the contents of the empty list in `[] == []`
|
||||
// This instruction will never execute, but we need an i32 for module validation
|
||||
LayoutRepr::Union(UnionLayout::NonRecursive(tags)) if tags.is_empty() => {
|
||||
LayoutRepr::Union(UnionLayout::NonRecursive([])) => {
|
||||
backend.code_builder.i32_const(!invert_result as i32);
|
||||
}
|
||||
|
||||
|
|
|
@ -250,9 +250,12 @@ fn crash_kw<'a>() -> impl Parser<'a, Expr<'a>, EExpr<'a>> {
|
|||
}
|
||||
}
|
||||
|
||||
// avoids ownership issues
|
||||
#[allow(clippy::blocks_in_conditions)]
|
||||
fn loc_possibly_negative_or_negated_term<'a>(
|
||||
options: ExprParseOptions,
|
||||
) -> impl Parser<'a, Loc<Expr<'a>>, EExpr<'a>> {
|
||||
|
||||
one_of![
|
||||
|arena, state: State<'a>, min_indent: u32| {
|
||||
let initial = state.clone();
|
||||
|
|
|
@ -2913,7 +2913,7 @@ where
|
|||
|
||||
pub fn iter_all(
|
||||
&self,
|
||||
) -> impl Iterator<Item = (SubsIndex<L>, SubsIndex<VariableSubsSlice>)> + ExactSizeIterator
|
||||
) -> impl ExactSizeIterator<Item = (SubsIndex<L>, SubsIndex<VariableSubsSlice>)>
|
||||
{
|
||||
self.labels().into_iter().zip(self.variables())
|
||||
}
|
||||
|
@ -2923,7 +2923,7 @@ where
|
|||
pub fn iter_from_subs<'a>(
|
||||
&'a self,
|
||||
subs: &'a Subs,
|
||||
) -> impl Iterator<Item = (&'a L, &'a [Variable])> + ExactSizeIterator {
|
||||
) -> impl ExactSizeIterator<Item = (&'a L, &'a [Variable])> {
|
||||
self.iter_all().map(move |(name_index, payload_index)| {
|
||||
(
|
||||
L::index_subs(subs, name_index),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue