]> git.lizzy.rs Git - rust.git/commit
Merge #2564
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Sun, 15 Dec 2019 11:20:50 +0000 (11:20 +0000)
committerGitHub <noreply@github.com>
Sun, 15 Dec 2019 11:20:50 +0000 (11:20 +0000)
commit6cbd8a4a4bbca8a7656df9f3ef849acebbf9ef9b
tree74ed89cf2ef03766a15c0ff6ba521ef1b509666c
parent3e8f9eb6c45b6bde294c79deea0e5bb02c084ae0
parent9a6d496497df35c0dbd8fa40574d47d0463997dd
Merge #2564

2564: Introduce named constants for highlighting tag names. r=matklad a=omerbenamram

Refers to #2563 .

This is just a refactor of all the tag strings to named constants as suggested by @matklad.
An enum could _probably_ prevent some future inconsistencies (since strings are still accepted), but I think the constants here are just fine - since the frontend only cares about strings anyways.

The frontend doesn't know about about those constants, so we'll still need to be mindful for them there.

Note: I didn't touch the `STYLE` const (big css blob), we could probably make it a `format!` string using something like `once_cell::Lazy`, let me know if this is something that needs fixing (since it doesn't seem like a useful API outside of tests).

Also - I left those consts private, I assume if they were some kind of API we would have made it into an enum?

Co-authored-by: Omer Ben-Amram <omerbenamram@gmail.com>