Switch to Rust 2024 edition (#18129)
This commit is contained in:
@@ -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!(
|
||||
|
||||
Reference in New Issue
Block a user