Commit 056ae8d
authored
Enable
Once in a lifetime, situation does not allow for `let` keyword in certain contexts (example below, not the best but still proves the point). There is no apparent downside to this extra wrap in `{}`. Alternatively, `let` can be safely remove instead of this.
This seemed so minor of a change that I did not bother with testing, reading any docs. I just saw no comments around the macro so I assumed it's safe to modify and write about. Sorry!
```rust
error: expected expression, found `let` statement
--> src/x.rs:185:23
|
185 | this1.and_then(|i| js!(o["this1"] = i));
| ^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
= note: this error originates in the macro `js` (in Nightly builds, run with -Z macro-backtrace for more info)
```js macro in more context1 parent 1d6cdc8 commit 056ae8d
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | | - | |
20 | 21 | | |
0 commit comments