Allow trailing commas in static suggestions

This commit is contained in:
Zalathar 2023-11-16 13:25:49 +11:00
parent 9144d51175
commit 3fdd84ab3a

View File

@ -2,7 +2,7 @@ use crate::{sug, Suggestion};
// FIXME: perhaps this could use `std::lazy` when it is stablizied
macro_rules! static_suggestions {
($( $glob:expr => [ $( $suggestion:expr ),* ] ),*) => {
($( $glob:expr => [ $( $suggestion:expr ),* $(,)? ] ),* $(,)? ) => {
pub(crate) const STATIC_SUGGESTIONS: ::once_cell::unsync::Lazy<Vec<(&'static str, Vec<Suggestion>)>>
= ::once_cell::unsync::Lazy::new(|| vec![ $( ($glob, vec![ $($suggestion),* ]) ),*]);
}
@ -10,15 +10,15 @@ macro_rules! static_suggestions {
static_suggestions! {
"*.md" => [
sug!("test", 0, ["linkchecker"])
sug!("test", 0, ["linkchecker"]),
],
"compiler/*" => [
sug!("check"),
sug!("test", 1, ["tests/ui", "tests/run-make"])
sug!("test", 1, ["tests/ui", "tests/run-make"]),
],
"src/librustdoc/*" => [
sug!("test", 1, ["rustdoc"])
]
sug!("test", 1, ["rustdoc"]),
],
}