mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Make clippy happy
This commit is contained in:
parent
26978b58b4
commit
eb7e39bf7b
5 changed files with 68 additions and 74 deletions
|
@ -89,13 +89,7 @@ impl Default for Pools {
|
|||
|
||||
impl Pools {
|
||||
pub fn new(num_pools: usize) -> Self {
|
||||
let mut pools = Vec::with_capacity(num_pools);
|
||||
|
||||
for _ in 0..num_pools {
|
||||
pools.push(Vec::new());
|
||||
}
|
||||
|
||||
Pools(pools)
|
||||
Pools(vec![Vec::new(); num_pools])
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
|
|
|
@ -676,7 +676,7 @@ fn write_boolean(env: &Env, boolean: Bool, subs: &Subs, buf: &mut String, parens
|
|||
|
||||
let combined = buffers.join(" | ");
|
||||
|
||||
buf.push_str("(");
|
||||
buf.push('(');
|
||||
write_content(
|
||||
env,
|
||||
subs.get_without_compacting(cvar).content,
|
||||
|
@ -686,7 +686,7 @@ fn write_boolean(env: &Env, boolean: Bool, subs: &Subs, buf: &mut String, parens
|
|||
);
|
||||
buf.push_str(" | ");
|
||||
buf.push_str(&combined);
|
||||
buf.push_str(")");
|
||||
buf.push(')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -716,7 +716,7 @@ fn write_apply(
|
|||
|
||||
let mut default_case = |subs, content| {
|
||||
if write_parens {
|
||||
buf.push_str("(");
|
||||
buf.push('(');
|
||||
}
|
||||
|
||||
write_content(env, content, subs, &mut arg_param, Parens::InTypeParam);
|
||||
|
@ -724,7 +724,7 @@ fn write_apply(
|
|||
buf.push_str(&arg_param);
|
||||
|
||||
if write_parens {
|
||||
buf.push_str(")");
|
||||
buf.push(')');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -762,13 +762,13 @@ fn write_apply(
|
|||
}
|
||||
_ => {
|
||||
if write_parens {
|
||||
buf.push_str("(");
|
||||
buf.push('(');
|
||||
}
|
||||
|
||||
write_symbol(env, symbol, buf);
|
||||
|
||||
for arg in args {
|
||||
buf.push_str(" ");
|
||||
buf.push(' ');
|
||||
write_content(
|
||||
env,
|
||||
subs.get_without_compacting(arg).content,
|
||||
|
@ -779,7 +779,7 @@ fn write_apply(
|
|||
}
|
||||
|
||||
if write_parens {
|
||||
buf.push_str(")");
|
||||
buf.push(')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -797,7 +797,7 @@ fn write_fn(
|
|||
let use_parens = parens != Parens::Unnecessary;
|
||||
|
||||
if use_parens {
|
||||
buf.push_str("(");
|
||||
buf.push('(');
|
||||
}
|
||||
|
||||
for arg in args {
|
||||
|
@ -826,7 +826,7 @@ fn write_fn(
|
|||
);
|
||||
|
||||
if use_parens {
|
||||
buf.push_str(")");
|
||||
buf.push(')');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1063,7 +1063,7 @@ fn write_error_type_help(
|
|||
|
||||
match error_type {
|
||||
Infinite => buf.push_str("∞"),
|
||||
Error => buf.push_str("?"),
|
||||
Error => buf.push('?'),
|
||||
FlexVar(name) => buf.push_str(name.as_str()),
|
||||
RigidVar(name) => buf.push_str(name.as_str()),
|
||||
Type(symbol, arguments) => {
|
||||
|
@ -1181,7 +1181,7 @@ fn write_debug_error_type_help(error_type: ErrorType, buf: &mut String, parens:
|
|||
|
||||
match error_type {
|
||||
Infinite => buf.push_str("∞"),
|
||||
Error => buf.push_str("?"),
|
||||
Error => buf.push('?'),
|
||||
FlexVar(name) => buf.push_str(name.as_str()),
|
||||
RigidVar(name) => buf.push_str(name.as_str()),
|
||||
Type(symbol, arguments) => {
|
||||
|
@ -1316,7 +1316,7 @@ fn write_debug_error_type_help(error_type: ErrorType, buf: &mut String, parens:
|
|||
while let Some((tag, args)) = it.next() {
|
||||
buf.push_str(&format!("{:?}", tag));
|
||||
for arg in args {
|
||||
buf.push_str(" ");
|
||||
buf.push(' ');
|
||||
write_debug_error_type_help(arg, buf, Parens::InTypeParam);
|
||||
}
|
||||
|
||||
|
@ -1335,7 +1335,7 @@ fn write_debug_error_type_help(error_type: ErrorType, buf: &mut String, parens:
|
|||
while let Some((tag, args)) = it.next() {
|
||||
buf.push_str(&format!("{:?}", tag));
|
||||
for arg in args {
|
||||
buf.push_str(" ");
|
||||
buf.push(' ');
|
||||
write_debug_error_type_help(arg, buf, Parens::Unnecessary);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue