mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: smarter if condition wrapping (#8201)
This commit is contained in:
@@ -2097,9 +2097,7 @@ fn (r Repo) find_user_by_id(id int) ?User {
|
||||
|
||||
fn main() {
|
||||
repo := Repo{
|
||||
users: [User{1, 'Andrew'}, User{2, 'Bob'},
|
||||
User{10, 'Charles'},
|
||||
]
|
||||
users: [User{1, 'Andrew'}, User{2, 'Bob'}, User{10, 'Charles'}]
|
||||
}
|
||||
user := repo.find_user_by_id(10) or { // Option types must be handled by `or` blocks
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user