fmt: remove additional line breaks after call_expr before params struct args (#19795)

This commit is contained in:
Turiiya 2023-11-07 13:32:36 +01:00 committed by GitHub
parent cd5c5561db
commit 22e17c3e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -1976,11 +1976,12 @@ fn (mut f Fmt) write_generic_call_if_require(node ast.CallExpr) {
} }
pub fn (mut f Fmt) call_args(args []ast.CallArg) { pub fn (mut f Fmt) call_args(args []ast.CallArg) {
f.single_line_fields = true old_single_line_fields_state := f.single_line_fields
old_short_arg_state := f.use_short_fn_args old_short_arg_state := f.use_short_fn_args
f.single_line_fields = true
f.use_short_fn_args = false f.use_short_fn_args = false
defer { defer {
f.single_line_fields = false f.single_line_fields = old_single_line_fields_state
f.use_short_fn_args = old_short_arg_state f.use_short_fn_args = old_short_arg_state
} }
for i, arg in args { for i, arg in args {

View File

@ -0,0 +1,10 @@
[params]
struct Bar {
bar bool
}
fn foo(msg string, opts Bar) {
println(msg)
}
foo(123.str(), bar: true)