diff --git a/crates/fmt/src/formatter.rs b/crates/fmt/src/formatter.rs index 9213235fe331..f36802f79d5a 100644 --- a/crates/fmt/src/formatter.rs +++ b/crates/fmt/src/formatter.rs @@ -1638,13 +1638,17 @@ impl<'a, W: Write> Formatter<'a, W> { ¶ms, ",", )?; - // Write new line if we have only one parameter and params first all multi set. + // Write new line if we have only one parameter and params first set, + // or if the function definition is multiline and all params set. if params.len() == 1 && - matches!( + (matches!( fmt.config.multiline_func_header, - MultilineFuncHeaderStyle::ParamsFirst | + MultilineFuncHeaderStyle::ParamsFirst + ) || params_multiline && + matches!( + fmt.config.multiline_func_header, MultilineFuncHeaderStyle::AllParams - ) + )) { writeln!(fmt.buf())?; }