From ea2669a9e064f0f1b8b020204a7080e1c8cf8214 Mon Sep 17 00:00:00 2001 From: Jan Haller Date: Sun, 23 Jun 2024 18:59:34 +0200 Subject: [PATCH] test-cfg-2 --- .github/other/apply-doc-cfg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/other/apply-doc-cfg.sh b/.github/other/apply-doc-cfg.sh index d8cfc5e9c..42671f9a1 100755 --- a/.github/other/apply-doc-cfg.sh +++ b/.github/other/apply-doc-cfg.sh @@ -61,7 +61,7 @@ find . -type f -name '*.rs' \ | while read -r file; do # Replace #[cfg(...)] with #[doc(cfg(...))]. Do not insert a newline, in case the #[cfg] is commented-out. # shellcheck disable=SC2016 - $sd '(\#\[(cfg\(.+?\))\])(\s)*([A-Za-z]|#\[)' '$1 #[cfg_attr(published_docs, doc($2))]\n$3$4' "$file" + $sd '(\#\[(cfg\(.+?\))\])(\s)*([A-Za-z]|#\[)' '$1 #[cfg_attr(published_docs, doc($2))]$3$4' "$file" # $sd '(\#\[(cfg\(.+?\))\])\s*([A-Za-z]|#\[)' '$1 #[doc($2)]\n$3' "$file" # ^^^^^^^^^^^^^^^^^ require that #[cfg] is followed by an identifier or a #[ attribute start. # This avoids some usages of function-local #[cfg]s, although by far not all. Others generate warnings, which is fine.