Commit 7a970c7
committed
Remove
`concat!` prevents `format_args!` from capturing variables from the
surrounding scope. Implementing `println!` using a nested `format_args`
removes this limitation allowing us to do the following:
```rust
let x = 3;
println!("{x}");
```
Similar to `std::println!`.
Also the change [does not impact performance][1].
[1]: rust-lang/rust#106824
Signed-off-by: Klimenty Tsoutsman <klim@tsoutsman.com>concat! from println! macro1 parent 18dc5f5 commit 7a970c7
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
| |||
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
201 | | - | |
| 203 | + | |
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
| |||
0 commit comments