mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-18 00:22:40 +02:00
Preserve line numbers by not injecting a newline (#2653)
The `dbg!` macro, being deployed more widely in #2478, shows the line number. But if we inject `#![allow(..)]\n` then the printed numbers do not match those in the textarea. It turns out that `\n` is not required! cc @egithinji
This commit is contained in:
parent
63cc474ba0
commit
63d716de90
@ -130,7 +130,7 @@ function playground_text(playground, hidden = true) {
|
|||||||
// Unless the code block has `warnunused`, allow all "unused" lints to avoid cluttering
|
// Unless the code block has `warnunused`, allow all "unused" lints to avoid cluttering
|
||||||
// the output.
|
// the output.
|
||||||
if(!classes.contains("warnunused")) {
|
if(!classes.contains("warnunused")) {
|
||||||
text = '#![allow(unused)]\n' + text;
|
text = '#![allow(unused)] ' + text;
|
||||||
}
|
}
|
||||||
let edition = "2015";
|
let edition = "2015";
|
||||||
if(classes.contains("edition2018")) {
|
if(classes.contains("edition2018")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user