Skip to content

Commit 8c7b7dd

Browse files
committed
Fix perf regression in non-autolinks
Before, this was compiling the regex on every single item in the crate. This would have been caught by `clippy::declare_interior_mutable_const`.
1 parent bc66b92 commit 8c7b7dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustdoc/passes/bare_urls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ crate const CHECK_BARE_URLS: Pass = Pass {
1616
description: "detects URLs that are not hyperlinks",
1717
};
1818

19-
const URL_REGEX: SyncLazy<Regex> = SyncLazy::new(|| {
19+
static URL_REGEX: SyncLazy<Regex> = SyncLazy::new(|| {
2020
Regex::new(concat!(
2121
r"https?://", // url scheme
2222
r"([-a-zA-Z0-9@:%._\+~#=]{2,256}\.)+", // one or more subdomains

0 commit comments

Comments
 (0)