Bump MSRV to Rust 1.80 (#13826)

This commit is contained in:
Micha Reiser 2024-10-20 10:55:36 +02:00 committed by GitHub
parent 075e378b0f
commit 27c50bebec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 110 additions and 133 deletions

View file

@ -1,6 +1,6 @@
use std::sync::LazyLock;
use {
itertools::Either::{Left, Right},
once_cell::sync::Lazy,
regex::Regex,
};
@ -60,7 +60,7 @@ impl Transformer for Normalizer {
}
fn visit_string_literal(&self, string_literal: &mut ast::StringLiteral) {
static STRIP_DOC_TESTS: Lazy<Regex> = Lazy::new(|| {
static STRIP_DOC_TESTS: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(
r"(?mx)
(
@ -75,14 +75,14 @@ impl Transformer for Normalizer {
)
.unwrap()
});
static STRIP_RST_BLOCKS: Lazy<Regex> = Lazy::new(|| {
static STRIP_RST_BLOCKS: LazyLock<Regex> = LazyLock::new(|| {
// This is kind of unfortunate, but it's pretty tricky (likely
// impossible) to detect a reStructuredText block with a simple
// regex. So we just look for the start of a block and remove
// everything after it. Talk about a hammer.
Regex::new(r"::(?s:.*)").unwrap()
});
static STRIP_MARKDOWN_BLOCKS: Lazy<Regex> = Lazy::new(|| {
static STRIP_MARKDOWN_BLOCKS: LazyLock<Regex> = LazyLock::new(|| {
// This covers more than valid Markdown blocks, but that's OK.
Regex::new(r"(```|~~~)\p{any}*(```|~~~|$)").unwrap()
});