File tree Expand file tree Collapse file tree
crates/ruff_python_parser/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1192,10 +1192,12 @@ impl<'src> Lexer<'src> {
11921192 /// that has no opening bracket or does not match it.
11931193 fn close_bracket ( & mut self , closing : char ) {
11941194 let start = self . token_range ( ) . start ( ) ;
1195- let at_interpolation_brace = self
1196- . interpolated_strings
1197- . current ( )
1198- . filter ( |interpolated_string| interpolated_string. is_at_interpolation_brace ( self . nesting ) ) ;
1195+ let at_interpolation_brace =
1196+ self . interpolated_strings
1197+ . current ( )
1198+ . filter ( |interpolated_string| {
1199+ interpolated_string. is_at_interpolation_brace ( self . nesting )
1200+ } ) ;
11991201 let error = match self . brackets . pop ( ) {
12001202 Some ( open) if open. kind == opening_bracket ( closing) => None ,
12011203 Some ( open) if open. kind == '{' && at_interpolation_brace. is_some ( ) => {
Original file line number Diff line number Diff line change @@ -822,7 +822,10 @@ impl<'src> Parser<'src> {
822822 }
823823
824824 fn parse_missing_identifier ( & mut self ) -> ast:: Identifier {
825- self . add_error ( ParseErrorType :: ExpectedIdentifier , self . current_token_range ( ) ) ;
825+ self . add_error (
826+ ParseErrorType :: ExpectedIdentifier ,
827+ self . current_token_range ( ) ,
828+ ) ;
826829
827830 ast:: Identifier {
828831 id : Name :: empty ( ) ,
@@ -1976,9 +1979,10 @@ impl<'src> Parser<'src> {
19761979 // test_err interpolated_string_escape_error
19771980 // f'a\N b{x}'
19781981 // t'{x}\x1' 'c'
1979- if let Some ( error) =
1980- std:: mem:: replace ( & mut self . interpolated_string_escape_error , outer_escape_error)
1981- {
1982+ if let Some ( error) = std:: mem:: replace (
1983+ & mut self . interpolated_string_escape_error ,
1984+ outer_escape_error,
1985+ ) {
19821986 self . add_error ( ParseErrorType :: Lexical ( error) , end_range) ;
19831987 }
19841988
You can’t perform that action at this time.
0 commit comments