Switch to Rust 2024 edition (#18129)

This commit is contained in:
Micha Reiser
2025-05-16 13:25:28 +02:00
committed by GitHub
parent e67b35743a
commit 9ae698fe30
1082 changed files with 4211 additions and 3300 deletions

View File

@@ -1,9 +1,9 @@
use std::borrow::Cow;
use ruff_formatter::{format_args, write, FormatError, FormatOptions, SourceCode};
use ruff_formatter::{FormatError, FormatOptions, SourceCode, format_args, write};
use ruff_python_ast::{AnyNodeRef, NodeKind, PySourceType};
use ruff_python_trivia::{
is_pragma_comment, lines_after, lines_after_ignoring_trivia, lines_before, CommentLinePosition,
CommentLinePosition, is_pragma_comment, lines_after, lines_after_ignoring_trivia, lines_before,
};
use ruff_text_size::{Ranged, TextLen, TextRange};
@@ -381,14 +381,13 @@ impl Format<PyFormatContext<'_>> for FormatTrailingEndOfLineComment<'_> {
0
} else {
// Start with 2 because of the two leading spaces.
let width = 2u32.saturating_add(
2u32.saturating_add(
TextWidth::from_text(&normalized_comment, f.options().indent_width())
.width()
.expect("Expected comment not to contain any newlines")
.value(),
);
width
)
};
write!(