many clippy fixes

This commit is contained in:
Anton-4 2023-04-24 16:21:46 +02:00
parent 7bbb37a843
commit 9748e4a4dc
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
17 changed files with 455 additions and 600 deletions

View file

@ -57,13 +57,7 @@ impl<'a> Formattable for TypeDef<'a> {
}
}
fn format_with_options(
&self,
buf: &mut Buf,
_parens: Parens,
newlines: Newlines,
indent: u16,
) {
fn format_with_options(&self, buf: &mut Buf, _parens: Parens, newlines: Newlines, indent: u16) {
use roc_parse::ast::TypeDef::*;
match self {
@ -205,13 +199,7 @@ impl<'a> Formattable for ValueDef<'a> {
}
}
fn format_with_options(
&self,
buf: &mut Buf,
_parens: Parens,
newlines: Newlines,
indent: u16,
) {
fn format_with_options(&self, buf: &mut Buf, _parens: Parens, newlines: Newlines, indent: u16) {
use roc_parse::ast::ValueDef::*;
match self {
Annotation(loc_pattern, loc_annotation) => {
@ -335,12 +323,7 @@ fn fmt_dbg_in_def<'a>(
condition.format(buf, return_indent);
}
fn fmt_expect<'a>(
buf: &mut Buf,
condition: &'a Loc<Expr<'a>>,
is_multiline: bool,
indent: u16,
) {
fn fmt_expect<'a>(buf: &mut Buf, condition: &'a Loc<Expr<'a>>, is_multiline: bool, indent: u16) {
buf.ensure_ends_with_newline();
buf.indent(indent);
buf.push_str("expect");
@ -356,12 +339,7 @@ fn fmt_expect<'a>(
condition.format(buf, return_indent);
}
fn fmt_expect_fx<'a>(
buf: &mut Buf,
condition: &'a Loc<Expr<'a>>,
is_multiline: bool,
indent: u16,
) {
fn fmt_expect_fx<'a>(buf: &mut Buf, condition: &'a Loc<Expr<'a>>, is_multiline: bool, indent: u16) {
buf.ensure_ends_with_newline();
buf.indent(indent);
buf.push_str("expect-fx");
@ -377,11 +355,7 @@ fn fmt_expect_fx<'a>(
condition.format(buf, return_indent);
}
pub fn fmt_value_def(
buf: &mut Buf,
def: &roc_parse::ast::ValueDef,
indent: u16,
) {
pub fn fmt_value_def(buf: &mut Buf, def: &roc_parse::ast::ValueDef, indent: u16) {
def.format(buf, indent);
}
@ -393,12 +367,7 @@ pub fn fmt_defs(buf: &mut Buf, defs: &Defs, indent: u16) {
defs.format(buf, indent);
}
pub fn fmt_body<'a>(
buf: &mut Buf,
pattern: &'a Pattern<'a>,
body: &'a Expr<'a>,
indent: u16,
) {
pub fn fmt_body<'a>(buf: &mut Buf, pattern: &'a Pattern<'a>, body: &'a Expr<'a>, indent: u16) {
pattern.format_with_options(buf, Parens::InApply, Newlines::No, indent);
buf.indent(indent);
buf.push_str(" =");