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