mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-30 15:17:59 +00:00
Bump MSRV to Rust 1.80 (#13826)
This commit is contained in:
parent
075e378b0f
commit
27c50bebec
42 changed files with 110 additions and 133 deletions
|
@ -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()
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue