@@ -1182,7 +1182,7 @@ impl Config {
1182
1182
// parse the value as a toml_edit::Document, and check that the (single)
1183
1183
// inner-most table is set via dotted keys.
1184
1184
let doc: toml_edit:: Document = arg. parse ( ) . with_context ( || {
1185
- format ! ( "failed to parse value from --config argument `{}` as a dotted key expression" , arg )
1185
+ format ! ( "failed to parse value from --config argument `{arg }` as a dotted key expression" )
1186
1186
} ) ?;
1187
1187
fn non_empty_decor ( d : & toml_edit:: Decor ) -> bool {
1188
1188
d. prefix ( ) . map_or ( false , |p| !p. trim ( ) . is_empty ( ) )
@@ -1204,67 +1204,62 @@ impl Config {
1204
1204
|| non_empty_decor ( nt. decor ( ) )
1205
1205
{
1206
1206
bail ! (
1207
- "--config argument `{}` \
1208
- includes non-whitespace decoration",
1209
- arg
1207
+ "--config argument `{arg}` \
1208
+ includes non-whitespace decoration"
1210
1209
)
1211
1210
}
1212
1211
table = nt;
1213
1212
}
1214
1213
Item :: Value ( v) if v. is_inline_table ( ) => {
1215
1214
bail ! (
1216
- "--config argument `{}` \
1217
- sets a value to an inline table, which is not accepted",
1218
- arg,
1215
+ "--config argument `{arg}` \
1216
+ sets a value to an inline table, which is not accepted"
1219
1217
) ;
1220
1218
}
1221
1219
Item :: Value ( v) => {
1222
1220
if non_empty_decor ( v. decor ( ) ) {
1223
1221
bail ! (
1224
- "--config argument `{}` \
1225
- includes non-whitespace decoration",
1226
- arg
1222
+ "--config argument `{arg}` \
1223
+ includes non-whitespace decoration"
1227
1224
)
1228
1225
}
1229
1226
got_to_value = true ;
1230
1227
break ;
1231
1228
}
1232
1229
Item :: ArrayOfTables ( _) => {
1233
1230
bail ! (
1234
- "--config argument `{}` \
1235
- sets a value to an array of tables, which is not accepted",
1236
- arg,
1231
+ "--config argument `{arg}` \
1232
+ sets a value to an array of tables, which is not accepted"
1237
1233
) ;
1238
1234
}
1239
1235
1240
1236
Item :: None => {
1241
- bail ! ( "--config argument `{}` doesn't provide a value" , arg )
1237
+ bail ! ( "--config argument `{arg }` doesn't provide a value" )
1242
1238
}
1243
1239
}
1244
1240
}
1245
1241
got_to_value
1246
1242
} ;
1247
1243
if !ok {
1248
1244
bail ! (
1249
- "--config argument `{}` was not a TOML dotted key expression (such as `build.jobs = 2`)" ,
1250
- arg
1245
+ "--config argument `{arg}` was not a TOML dotted key expression (such as `build.jobs = 2`)"
1251
1246
) ;
1252
1247
}
1253
1248
1254
1249
let toml_v = toml:: from_document ( doc) . with_context ( || {
1255
- format ! ( "failed to parse value from --config argument `{}`" , arg )
1250
+ format ! ( "failed to parse value from --config argument `{arg }`" )
1256
1251
} ) ?;
1257
1252
1258
1253
CV :: from_toml ( Definition :: Cli , toml_v)
1259
- . with_context ( || format ! ( "failed to convert --config argument `{}`" , arg ) ) ?
1254
+ . with_context ( || format ! ( "failed to convert --config argument `{arg }`" ) ) ?
1260
1255
} ;
1261
1256
let mut seen = HashSet :: new ( ) ;
1262
1257
let tmp_table = self
1263
1258
. load_includes ( tmp_table, & mut seen)
1264
1259
. with_context ( || "failed to load --config include" . to_string ( ) ) ?;
1265
1260
loaded_args
1266
1261
. merge ( tmp_table, true )
1267
- . with_context ( || format ! ( "failed to merge --config argument `{}`" , arg ) ) ?;
1262
+ . with_context ( || format ! ( "failed to merge --config argument `{arg }`" ) ) ?;
1268
1263
}
1269
1264
Ok ( loaded_args)
1270
1265
}
0 commit comments