mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-07 20:28:12 +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
|
@ -37,7 +37,7 @@
|
|||
use crate::db::Db;
|
||||
use ruff_db::files::File;
|
||||
use ruff_db::parsed::parsed_module;
|
||||
use ruff_db::source::{line_index, source_text, SourceText};
|
||||
use ruff_db::source::{SourceText, line_index, source_text};
|
||||
use ruff_python_trivia::{CommentRanges, Cursor};
|
||||
use ruff_source_file::{LineIndex, OneIndexed};
|
||||
use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
|
||||
|
@ -482,7 +482,9 @@ pub(crate) enum ErrorAssertionParseError<'a> {
|
|||
MultipleRuleCodes,
|
||||
#[error("expected '\"' to be the final character in an assertion with an error message")]
|
||||
UnclosedMessage,
|
||||
#[error("unexpected character `{character}` at offset {offset} (relative to the `:` in the assertion comment)")]
|
||||
#[error(
|
||||
"unexpected character `{character}` at offset {offset} (relative to the `:` in the assertion comment)"
|
||||
)]
|
||||
UnexpectedCharacter { character: char, offset: usize },
|
||||
}
|
||||
|
||||
|
@ -681,8 +683,10 @@ mod tests {
|
|||
assert_eq!(line1.line_number, OneIndexed::from_zero_indexed(2));
|
||||
assert_eq!(line2.line_number, OneIndexed::from_zero_indexed(3));
|
||||
|
||||
let [UnparsedAssertion::Error(error1), UnparsedAssertion::Revealed(expected_ty)] =
|
||||
&line1.assertions[..]
|
||||
let [
|
||||
UnparsedAssertion::Error(error1),
|
||||
UnparsedAssertion::Revealed(expected_ty),
|
||||
] = &line1.assertions[..]
|
||||
else {
|
||||
panic!("expected one error assertion and one Revealed assertion");
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue