1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: keep empty curlies and parenthesis as they are (#7329)

This commit is contained in:
Lukas Neubert
2020-12-22 23:43:48 +01:00
committed by GitHub
parent a47749b204
commit a2cd1b163c
6 changed files with 131 additions and 59 deletions

View File

@@ -1509,8 +1509,7 @@ fn main() {
## References
```v
struct Foo {
}
struct Foo {}
fn (foo Foo) bar_method() {
// ...
@@ -1730,8 +1729,7 @@ struct Dog {
breed string
}
struct Cat {
}
struct Cat {}
fn (d Dog) speak() string {
return 'woof'
@@ -1800,14 +1798,11 @@ A sum type instance can hold a value of several different types. Use the `type`
keyword to declare a sum type:
```v
struct Moon {
}
struct Moon {}
struct Mars {
}
struct Mars {}
struct Venus {
}
struct Venus {}
type World = Mars | Moon | Venus
@@ -1824,14 +1819,11 @@ To check whether a sum type instance holds a certain type, use `sum is Type`.
To cast a sum type to one of its variants you can use `sum as Type`:
```v
struct Moon {
}
struct Moon {}
struct Mars {
}
struct Mars {}
struct Venus {
}
struct Venus {}
type World = Mars | Moon | Venus
@@ -1883,14 +1875,11 @@ complex expression than just a variable name.
You can also use `match` to determine the variant:
```v
struct Moon {
}
struct Moon {}
struct Mars {
}
struct Mars {}
struct Venus {
}
struct Venus {}
type World = Mars | Moon | Venus