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

@ -2,15 +2,15 @@
// "reStructuredText."
#![allow(clippy::doc_markdown)]
use itertools::Itertools;
use std::cmp::Ordering;
use std::sync::LazyLock;
use std::{borrow::Cow, collections::VecDeque};
use itertools::Itertools;
use regex::Regex;
use ruff_formatter::printer::SourceMapGeneration;
use ruff_python_ast::{str::Quote, StringFlags};
use ruff_python_trivia::CommentRanges;
use {once_cell::sync::Lazy, regex::Regex};
use {
ruff_formatter::{write, FormatOptions, IndentStyle, LineWidth, Printed},
ruff_python_trivia::{is_python_whitespace, PythonWhitespace},
@ -1075,7 +1075,7 @@ impl<'src> CodeExampleRst<'src> {
// [directives]: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#directives
// [Pygments lexer names]: https://pygments.org/docs/lexers/
// [code-block]: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block
static DIRECTIVE_START: Lazy<Regex> = Lazy::new(|| {
static DIRECTIVE_START: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(
r"(?m)^\s*\.\. \s*(?i:code-block|sourcecode)::\s*(?i:python|py|python3|py3)$",
)
@ -1320,7 +1320,7 @@ impl<'src> CodeExampleMarkdown<'src> {
///
/// [fenced code block]: https://spec.commonmark.org/0.30/#fenced-code-blocks
fn new(original: InputDocstringLine<'src>) -> Option<CodeExampleMarkdown<'src>> {
static FENCE_START: Lazy<Regex> = Lazy::new(|| {
static FENCE_START: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(
r"(?xm)
^