mirror of
https://github.com/vlang/v.git
synced 2025-09-17 03:17:25 -04:00
v fmt: fix extra space for anon struct (#16131)
This commit is contained in:
parent
c684dd8c9b
commit
2e8b9e3b92
@ -12,13 +12,14 @@ pub fn (mut f Fmt) struct_decl(node ast.StructDecl, is_anon bool) {
|
||||
f.write('pub ')
|
||||
}
|
||||
if node.is_union {
|
||||
f.write('union ')
|
||||
f.write('union')
|
||||
} else {
|
||||
f.write('struct ')
|
||||
f.write('struct')
|
||||
}
|
||||
f.write_language_prefix(node.language)
|
||||
name := node.name.after('.') // strip prepended module
|
||||
if !is_anon {
|
||||
f.write(' ')
|
||||
f.write_language_prefix(node.language)
|
||||
f.write(name)
|
||||
}
|
||||
f.write_generic_types(node.generic_types)
|
||||
|
Loading…
x
Reference in New Issue
Block a user