mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-16 16:40:36 +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
|
@ -1070,12 +1070,14 @@ impl<'a> Generator<'a> {
|
|||
self.unparse_expr(func, precedence::MAX);
|
||||
self.p("(");
|
||||
if let (
|
||||
[Expr::Generator(ast::ExprGenerator {
|
||||
elt,
|
||||
generators,
|
||||
range: _,
|
||||
parenthesized: _,
|
||||
})],
|
||||
[
|
||||
Expr::Generator(ast::ExprGenerator {
|
||||
elt,
|
||||
generators,
|
||||
range: _,
|
||||
parenthesized: _,
|
||||
}),
|
||||
],
|
||||
[],
|
||||
) = (arguments.args.as_ref(), arguments.keywords.as_ref())
|
||||
{
|
||||
|
@ -1435,7 +1437,7 @@ impl<'a> Generator<'a> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ruff_python_ast::{Mod, ModModule};
|
||||
use ruff_python_parser::{self, parse_module, Mode, ParseOptions};
|
||||
use ruff_python_parser::{self, Mode, ParseOptions, parse_module};
|
||||
use ruff_source_file::LineEnding;
|
||||
|
||||
use crate::stylist::Indentation;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
pub use generator::Generator;
|
||||
use ruff_python_parser::{parse_module, ParseError};
|
||||
use ruff_python_parser::{ParseError, parse_module};
|
||||
pub use stylist::Stylist;
|
||||
|
||||
mod generator;
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::ops::Deref;
|
|||
|
||||
use ruff_python_ast::str::Quote;
|
||||
use ruff_python_parser::{Token, TokenKind, Tokens};
|
||||
use ruff_source_file::{find_newline, LineEnding, LineRanges};
|
||||
use ruff_source_file::{LineEnding, LineRanges, find_newline};
|
||||
use ruff_text_size::Ranged;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -49,7 +49,7 @@ fn detect_quote(tokens: &[Token]) -> Quote {
|
|||
for token in tokens {
|
||||
match token.kind() {
|
||||
TokenKind::String if !token.is_triple_quoted_string() => {
|
||||
return token.string_quote_style()
|
||||
return token.string_quote_style();
|
||||
}
|
||||
TokenKind::FStringStart => return token.string_quote_style(),
|
||||
_ => continue,
|
||||
|
@ -148,8 +148,8 @@ impl Deref for Indentation {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ruff_python_parser::{parse_module, parse_unchecked, Mode, ParseOptions};
|
||||
use ruff_source_file::{find_newline, LineEnding};
|
||||
use ruff_python_parser::{Mode, ParseOptions, parse_module, parse_unchecked};
|
||||
use ruff_source_file::{LineEnding, find_newline};
|
||||
|
||||
use super::{Indentation, Quote, Stylist};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue