mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-23 03:44:31 +00:00
Switch to Rust 2024 edition (#18129)
This commit is contained in:
parent
e67b35743a
commit
9ae698fe30
1082 changed files with 4211 additions and 3300 deletions
|
@ -1,4 +1,4 @@
|
|||
use ruff_formatter::{write, Argument, Arguments, FormatError};
|
||||
use ruff_formatter::{Argument, Arguments, FormatError, write};
|
||||
use ruff_python_ast::AnyNodeRef;
|
||||
use ruff_python_ast::{
|
||||
ElifElseClause, ExceptHandlerExceptHandler, MatchCase, StmtClassDef, StmtFor, StmtFunctionDef,
|
||||
|
@ -7,8 +7,8 @@ use ruff_python_ast::{
|
|||
use ruff_python_trivia::{SimpleToken, SimpleTokenKind, SimpleTokenizer};
|
||||
use ruff_text_size::{Ranged, TextRange, TextSize};
|
||||
|
||||
use crate::comments::{leading_alternate_branch_comments, trailing_comments, SourceComment};
|
||||
use crate::statement::suite::{contains_only_an_ellipsis, SuiteKind};
|
||||
use crate::comments::{SourceComment, leading_alternate_branch_comments, trailing_comments};
|
||||
use crate::statement::suite::{SuiteKind, contains_only_an_ellipsis};
|
||||
use crate::verbatim::write_suppressed_clause_header;
|
||||
use crate::{has_skip_comment, prelude::*};
|
||||
|
||||
|
@ -473,12 +473,22 @@ fn colon_range(after_keyword_or_condition: TextSize, source: &str) -> FormatResu
|
|||
range,
|
||||
}) => Ok(range),
|
||||
Some(token) => {
|
||||
debug_assert!(false, "Expected the colon marking the end of the case header but found {token:?} instead.");
|
||||
Err(FormatError::syntax_error("Expected colon marking the end of the case header but found another token instead."))
|
||||
debug_assert!(
|
||||
false,
|
||||
"Expected the colon marking the end of the case header but found {token:?} instead."
|
||||
);
|
||||
Err(FormatError::syntax_error(
|
||||
"Expected colon marking the end of the case header but found another token instead.",
|
||||
))
|
||||
}
|
||||
None => {
|
||||
debug_assert!(false, "Expected the colon marking the end of the case header but found the end of the range.");
|
||||
Err(FormatError::syntax_error("Expected the colon marking the end of the case header but found the end of the range."))
|
||||
debug_assert!(
|
||||
false,
|
||||
"Expected the colon marking the end of the case header but found the end of the range."
|
||||
);
|
||||
Err(FormatError::syntax_error(
|
||||
"Expected the colon marking the end of the case header but found the end of the range.",
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue