Skip to content

Shrink code block annotation after a comma #2643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 22, 2020

Conversation

JohnTitor
Copy link
Member

The Rust-specific code block annotations like no_run are used in doc testing through doc-comment or similar crates, and other services seem to ignore characters after a comma.
This removes characters from the annotations after a comma.
Since this is additional work, this may affect performance a bit, but from the benchmarks, it looks fine.
Also this allows language-toml class as it's supposed to be used widely.

Small input:

test bench_orig    ... bench:       1,363 ns/iter (+/- 29)
test bench_tweaked ... bench:       1,498 ns/iter (+/- 28)

Large input (about 2k COL):

test bench_orig    ... bench:     634,254 ns/iter (+/- 10,553)
test bench_tweaked ... bench:     636,279 ns/iter (+/- 13,216)

Fixes #1150

r? @jtgeibel

@jtgeibel
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jul 22, 2020

📌 Commit 7cba38b has been approved by jtgeibel

@bors
Copy link
Contributor

bors commented Jul 22, 2020

⌛ Testing commit 7cba38b with merge 4f03f03...

@bors
Copy link
Contributor

bors commented Jul 22, 2020

☀️ Test successful - checks-travis
Approved by: jtgeibel
Pushing 4f03f03 to master...

@bors bors merged commit 4f03f03 into rust-lang:master Jul 22, 2020
@JohnTitor JohnTitor deleted the code-block-annot branch July 22, 2020 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no_run in language specifier in a markdown block breaks syntax highlighting
4 participants