@@ -103,12 +103,12 @@ pub fn parse_format_exprs(input: &str) -> Result<(String, Vec<Arg>), ()> {
103
103
output. push ( chr) ;
104
104
extracted_expressions. push ( Arg :: Placeholder ) ;
105
105
state = State :: NotArg ;
106
- } ,
106
+ }
107
107
( State :: MaybeArg , ':' ) => {
108
108
output. push ( chr) ;
109
109
extracted_expressions. push ( Arg :: Placeholder ) ;
110
110
state = State :: FormatOpts ;
111
- } ,
111
+ }
112
112
( State :: MaybeArg , _) => {
113
113
if matches ! ( chr, '\\' | '$' ) {
114
114
current_expr. push ( '\\' ) ;
@@ -122,13 +122,13 @@ pub fn parse_format_exprs(input: &str) -> Result<(String, Vec<Arg>), ()> {
122
122
} else {
123
123
state = State :: Expr ;
124
124
}
125
- } ,
125
+ }
126
126
( State :: Ident | State :: Expr , ':' ) if matches ! ( chars. peek( ) , Some ( ':' ) ) => {
127
127
// path separator
128
128
state = State :: Expr ;
129
129
current_expr. push_str ( "::" ) ;
130
130
chars. next ( ) ;
131
- } ,
131
+ }
132
132
( State :: Ident | State :: Expr , ':' | '}' ) => {
133
133
if inexpr_open_count == 0 {
134
134
let trimmed = current_expr. trim ( ) ;
@@ -146,7 +146,13 @@ pub fn parse_format_exprs(input: &str) -> Result<(String, Vec<Arg>), ()> {
146
146
147
147
output. push ( chr) ;
148
148
current_expr. clear ( ) ;
149
- state = if chr == ':' { State :: FormatOpts } else if chr == '}' { State :: NotArg } else { unreachable ! ( ) } ;
149
+ state = if chr == ':' {
150
+ State :: FormatOpts
151
+ } else if chr == '}' {
152
+ State :: NotArg
153
+ } else {
154
+ unreachable ! ( )
155
+ } ;
150
156
} else if chr == '}' {
151
157
// We're closing one brace met before inside of the expression.
152
158
current_expr. push ( chr) ;
@@ -155,7 +161,7 @@ pub fn parse_format_exprs(input: &str) -> Result<(String, Vec<Arg>), ()> {
155
161
// We're inside of braced expression, assume that it's a struct field name/value delimiter.
156
162
current_expr. push ( chr) ;
157
163
}
158
- } ,
164
+ }
159
165
( State :: Ident | State :: Expr , '{' ) => {
160
166
state = State :: Expr ;
161
167
current_expr. push ( chr) ;
0 commit comments