@@ -4,7 +4,7 @@ use syntax::{ast, ptr};
4
4
use crate :: config:: lists:: * ;
5
5
use crate :: config:: Version ;
6
6
use crate :: expr:: { block_contains_comment, is_simple_block, is_unsafe_block, rewrite_cond} ;
7
- use crate :: items:: { span_hi_for_arg , span_lo_for_arg } ;
7
+ use crate :: items:: { span_hi_for_param , span_lo_for_param } ;
8
8
use crate :: lists:: { definitive_tactic, itemize_list, write_list, ListFormatting , Separator } ;
9
9
use crate :: overflow:: OverflowableItem ;
10
10
use crate :: rewrite:: { Rewrite , RewriteContext } ;
@@ -232,37 +232,37 @@ fn rewrite_closure_fn_decl(
232
232
. sub_width ( 4 ) ?;
233
233
234
234
// 1 = |
235
- let argument_offset = nested_shape. indent + 1 ;
236
- let arg_shape = nested_shape. offset_left ( 1 ) ?. visual_indent ( 0 ) ;
237
- let ret_str = fn_decl. output . rewrite ( context, arg_shape ) ?;
235
+ let param_offset = nested_shape. indent + 1 ;
236
+ let param_shape = nested_shape. offset_left ( 1 ) ?. visual_indent ( 0 ) ;
237
+ let ret_str = fn_decl. output . rewrite ( context, param_shape ) ?;
238
238
239
- let arg_items = itemize_list (
239
+ let param_items = itemize_list (
240
240
context. snippet_provider ,
241
241
fn_decl. inputs . iter ( ) ,
242
242
"|" ,
243
243
"," ,
244
- |arg| span_lo_for_arg ( arg ) ,
245
- |arg| span_hi_for_arg ( context, arg ) ,
246
- |arg| arg . rewrite ( context, arg_shape ) ,
244
+ |param| span_lo_for_param ( param ) ,
245
+ |param| span_hi_for_param ( context, param ) ,
246
+ |param| param . rewrite ( context, param_shape ) ,
247
247
context. snippet_provider . span_after ( span, "|" ) ,
248
248
body. span . lo ( ) ,
249
249
false ,
250
250
) ;
251
- let item_vec = arg_items . collect :: < Vec < _ > > ( ) ;
252
- // 1 = space between arguments and return type.
251
+ let item_vec = param_items . collect :: < Vec < _ > > ( ) ;
252
+ // 1 = space between parameters and return type.
253
253
let horizontal_budget = nested_shape. width . saturating_sub ( ret_str. len ( ) + 1 ) ;
254
254
let tactic = definitive_tactic (
255
255
& item_vec,
256
256
ListTactic :: HorizontalVertical ,
257
257
Separator :: Comma ,
258
258
horizontal_budget,
259
259
) ;
260
- let arg_shape = match tactic {
261
- DefinitiveListTactic :: Horizontal => arg_shape . sub_width ( ret_str. len ( ) + 1 ) ?,
262
- _ => arg_shape ,
260
+ let param_shape = match tactic {
261
+ DefinitiveListTactic :: Horizontal => param_shape . sub_width ( ret_str. len ( ) + 1 ) ?,
262
+ _ => param_shape ,
263
263
} ;
264
264
265
- let fmt = ListFormatting :: new ( arg_shape , context. config )
265
+ let fmt = ListFormatting :: new ( param_shape , context. config )
266
266
. tactic ( tactic)
267
267
. preserve_newline ( true ) ;
268
268
let list_str = write_list ( & item_vec, & fmt) ?;
@@ -271,7 +271,7 @@ fn rewrite_closure_fn_decl(
271
271
if !ret_str. is_empty ( ) {
272
272
if prefix. contains ( '\n' ) {
273
273
prefix. push ( '\n' ) ;
274
- prefix. push_str ( & argument_offset . to_string ( context. config ) ) ;
274
+ prefix. push_str ( & param_offset . to_string ( context. config ) ) ;
275
275
} else {
276
276
prefix. push ( ' ' ) ;
277
277
}
0 commit comments