Skip to content

Commit 22fe6a5

Browse files
refactor: stylistic improvements
1 parent 082ba05 commit 22fe6a5

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/closures.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -285,23 +285,21 @@ fn rewrite_closure_fn_decl(
285285
IndentStyle::Block => list_str.contains('\n') || list_str.len() > one_line_budget,
286286
_ => false,
287287
};
288-
let (param_str, put_params_in_block) = if multi_line_params && !item_vec.is_empty() {
288+
let put_params_in_block = multi_line_params && !item_vec.is_empty();
289+
let param_str = if put_params_in_block {
289290
let trailing_comma = match context.config.trailing_comma() {
290291
SeparatorTactic::Never => "",
291292
_ => ",",
292293
};
293-
(
294-
format!(
295-
"{}{}{}{}",
296-
param_shape.indent.to_string_with_newline(context.config),
297-
&list_str,
298-
trailing_comma,
299-
shape.indent.to_string_with_newline(context.config)
300-
),
301-
true,
294+
format!(
295+
"{}{}{}{}",
296+
param_shape.indent.to_string_with_newline(context.config),
297+
&list_str,
298+
trailing_comma,
299+
shape.indent.to_string_with_newline(context.config)
302300
)
303301
} else {
304-
(list_str, false)
302+
list_str
305303
};
306304
let mut prefix = format!("{}{}{}|{}|", is_async, immovable, mover, param_str);
307305

0 commit comments

Comments
 (0)