Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Oct 22, 2024
1 parent 28245ba commit c26a5f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions crates/ruff_python_formatter/src/string/implicit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ impl<'a> FormatImplicitConcatenatedStringFlat<'a> {
.is_some_and(|quote| quote != part.flags().quote_style())
{
return None;
} else {
preserve_quotes_requirement = Some(part.flags().quote_style());
}
preserve_quotes_requirement = Some(part.flags().quote_style());
}
}
}
Expand Down
13 changes: 5 additions & 8 deletions crates/ruff_python_formatter/src/string/normalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ use std::cmp::Ordering;
use std::iter::FusedIterator;

use ruff_formatter::FormatContext;
use ruff_python_ast::visitor::source_order::SourceOrderVisitor;
use ruff_python_ast::{
AnyStringFlags, BytesLiteral, FString, str::Quote, StringFlags, StringLikePart,
StringLiteral,
str::Quote, AnyStringFlags, BytesLiteral, FString, StringFlags, StringLikePart, StringLiteral,
};
use ruff_python_ast::visitor::source_order::SourceOrderVisitor;
use ruff_text_size::{Ranged, TextRange};

use crate::context::FStringState;
use crate::prelude::*;
use crate::preview::is_f_string_formatting_enabled;
use crate::QuoteStyle;
use crate::string::{Quoting, StringQuotes};
use crate::QuoteStyle;

pub(crate) struct StringNormalizer<'a, 'src> {
quoting: Quoting,
Expand Down Expand Up @@ -1005,17 +1004,15 @@ pub(super) fn is_fstring_with_triple_quoted_literal_expression_containing_quotes
mod tests {
use std::borrow::Cow;

use ruff_python_ast::str_prefix::FStringPrefix;
use ruff_python_ast::{
AnyStringFlags,
str::Quote,
str_prefix::{AnyStringPrefix, ByteStringPrefix},
AnyStringFlags,
};
use ruff_python_ast::str_prefix::FStringPrefix;

use crate::string::normalize_string;
use crate::string::normalize_string;

use super::UnicodeEscape;
use super::UnicodeEscape;

#[test]
Expand Down

0 comments on commit c26a5f5

Please sign in to comment.