fmt: insert space in front of `?` for propagation (#6250)
parent
1bf7e1596b
commit
4d425b0e6d
|
@ -1635,7 +1635,7 @@ propagate the error:
|
|||
import net.http
|
||||
|
||||
fn f(url string) ?string {
|
||||
resp := http.get(url)?
|
||||
resp := http.get(url) ?
|
||||
return resp.text
|
||||
}
|
||||
```
|
||||
|
|
|
@ -1136,7 +1136,7 @@ pub fn (mut f Fmt) or_expr(or_block ast.OrExpr) {
|
|||
}
|
||||
}
|
||||
.propagate {
|
||||
f.write('?')
|
||||
f.write(' ?')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
fn opt_propagate() ?int {
|
||||
eventual_wrong_int()?
|
||||
eventual_wrong_int() ?
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ fn find_all_customers(db sqlite.DB) []Customer {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
db := sqlite.connect('customers.db')?
|
||||
db := sqlite.connect('customers.db') ?
|
||||
// select count(*) from Customer
|
||||
nr_customers := sql db {
|
||||
select count from Customer
|
||||
|
|
Loading…
Reference in New Issue