mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
1.65 clippy fixes
This commit is contained in:
parent
f0d6e418fa
commit
66a1ba00eb
53 changed files with 224 additions and 225 deletions
|
@ -166,8 +166,8 @@ impl<'a> Formattable for TypeAnnotation<'a> {
|
|||
|
||||
Wildcard | Inferred | BoundVariable(_) | Malformed(_) => false,
|
||||
Function(args, result) => {
|
||||
(&result.value).is_multiline()
|
||||
|| args.iter().any(|loc_arg| (&loc_arg.value).is_multiline())
|
||||
result.value.is_multiline()
|
||||
|| args.iter().any(|loc_arg| loc_arg.value.is_multiline())
|
||||
}
|
||||
Apply(_, _, args) => args.iter().any(|loc_arg| loc_arg.value.is_multiline()),
|
||||
As(lhs, _, _) => lhs.value.is_multiline(),
|
||||
|
@ -226,7 +226,7 @@ impl<'a> Formattable for TypeAnnotation<'a> {
|
|||
buf.newline();
|
||||
}
|
||||
|
||||
(&argument.value).format_with_options(
|
||||
argument.value.format_with_options(
|
||||
buf,
|
||||
Parens::InFunctionType,
|
||||
Newlines::No,
|
||||
|
@ -251,7 +251,7 @@ impl<'a> Formattable for TypeAnnotation<'a> {
|
|||
buf.push_str("->");
|
||||
buf.spaces(1);
|
||||
|
||||
(&ret.value).format_with_options(buf, Parens::InFunctionType, Newlines::No, indent);
|
||||
ret.value.format_with_options(buf, Parens::InFunctionType, Newlines::No, indent);
|
||||
|
||||
if needs_parens {
|
||||
buf.push(')')
|
||||
|
@ -275,7 +275,7 @@ impl<'a> Formattable for TypeAnnotation<'a> {
|
|||
|
||||
for argument in *arguments {
|
||||
buf.spaces(1);
|
||||
(&argument.value).format_with_options(
|
||||
argument.value.format_with_options(
|
||||
buf,
|
||||
Parens::InApply,
|
||||
Newlines::No,
|
||||
|
@ -497,7 +497,7 @@ impl<'a> Formattable for Tag<'a> {
|
|||
use self::Tag::*;
|
||||
|
||||
match self {
|
||||
Apply { args, .. } => args.iter().any(|arg| (&arg.value).is_multiline()),
|
||||
Apply { args, .. } => args.iter().any(|arg| arg.value.is_multiline()),
|
||||
Tag::SpaceBefore(_, _) | Tag::SpaceAfter(_, _) => true,
|
||||
Malformed(text) => text.chars().any(|c| c == '\n'),
|
||||
}
|
||||
|
|
|
@ -542,7 +542,7 @@ fn fmt_binops<'a, 'buf>(
|
|||
indent: u16,
|
||||
) {
|
||||
let is_multiline = part_of_multi_line_binops
|
||||
|| (&loc_right_side.value).is_multiline()
|
||||
|| loc_right_side.value.is_multiline()
|
||||
|| lefts.iter().any(|(expr, _)| expr.value.is_multiline());
|
||||
|
||||
for (loc_left_side, loc_binop) in lefts {
|
||||
|
@ -1045,7 +1045,7 @@ fn fmt_closure<'a, 'buf>(
|
|||
|
||||
buf.push_str("->");
|
||||
|
||||
let is_multiline = (&loc_ret.value).is_multiline();
|
||||
let is_multiline = loc_ret.value.is_multiline();
|
||||
|
||||
// If the body is multiline, go down a line and indent.
|
||||
let body_indent = if is_multiline {
|
||||
|
@ -1156,7 +1156,7 @@ fn fmt_backpassing<'a, 'buf>(
|
|||
|
||||
buf.push_str("<-");
|
||||
|
||||
let is_multiline = (&loc_ret.value).is_multiline();
|
||||
let is_multiline = loc_ret.value.is_multiline();
|
||||
|
||||
// If the body is multiline, go down a line and indent.
|
||||
let body_indent = if is_multiline {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue