@@ -103,12 +103,12 @@ pub fn parse_format_exprs(input: &str) -> Result<(String, Vec<Arg>), ()> {
103103 output. push ( chr) ;
104104 extracted_expressions. push ( Arg :: Placeholder ) ;
105105 state = State :: NotArg ;
106- } ,
106+ }
107107 ( State :: MaybeArg , ':' ) => {
108108 output. push ( chr) ;
109109 extracted_expressions. push ( Arg :: Placeholder ) ;
110110 state = State :: FormatOpts ;
111- } ,
111+ }
112112 ( State :: MaybeArg , _) => {
113113 if matches ! ( chr, '\\' | '$' ) {
114114 current_expr. push ( '\\' ) ;
@@ -122,13 +122,13 @@ pub fn parse_format_exprs(input: &str) -> Result<(String, Vec<Arg>), ()> {
122122 } else {
123123 state = State :: Expr ;
124124 }
125- } ,
125+ }
126126 ( State :: Ident | State :: Expr , ':' ) if matches ! ( chars. peek( ) , Some ( ':' ) ) => {
127127 // path separator
128128 state = State :: Expr ;
129129 current_expr. push_str ( "::" ) ;
130130 chars. next ( ) ;
131- } ,
131+ }
132132 ( State :: Ident | State :: Expr , ':' | '}' ) => {
133133 if inexpr_open_count == 0 {
134134 let trimmed = current_expr. trim ( ) ;
@@ -146,7 +146,13 @@ pub fn parse_format_exprs(input: &str) -> Result<(String, Vec<Arg>), ()> {
146146
147147 output. push ( chr) ;
148148 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+ } ;
150156 } else if chr == '}' {
151157 // We're closing one brace met before inside of the expression.
152158 current_expr. push ( chr) ;
@@ -155,7 +161,7 @@ pub fn parse_format_exprs(input: &str) -> Result<(String, Vec<Arg>), ()> {
155161 // We're inside of braced expression, assume that it's a struct field name/value delimiter.
156162 current_expr. push ( chr) ;
157163 }
158- } ,
164+ }
159165 ( State :: Ident | State :: Expr , '{' ) => {
160166 state = State :: Expr ;
161167 current_expr. push ( chr) ;
0 commit comments