@@ -22,7 +22,7 @@ struct Block {
22
22
indent : usize ,
23
23
margin_left : usize ,
24
24
margin_right : usize ,
25
- bodys : Vec < ( usize , String ) > , // The vector of tuples of (first indent, text)
25
+ bodies : Vec < ( usize , String ) > , // The vector of tuples of (first indent, text)
26
26
27
27
_spaces : String ,
28
28
}
@@ -94,7 +94,7 @@ impl Help {
94
94
indent : indent,
95
95
margin_left : margin_left,
96
96
margin_right : margin_right,
97
- bodys : vec ! [ ( 0 , text) ] ,
97
+ bodies : vec ! [ ( 0 , text) ] ,
98
98
_spaces : " " . repeat ( max_len) ,
99
99
} ;
100
100
self . blocks . push ( block) ;
@@ -153,7 +153,7 @@ impl Help {
153
153
indent : indent,
154
154
margin_left : margin_left,
155
155
margin_right : margin_right,
156
- bodys : texts. into_iter ( ) . map ( |s| ( 0 , s) ) . collect ( ) ,
156
+ bodies : texts. into_iter ( ) . map ( |s| ( 0 , s) ) . collect ( ) ,
157
157
_spaces : " " . repeat ( max_len) ,
158
158
} ;
159
159
self . blocks . push ( block) ;
@@ -208,10 +208,10 @@ impl Help {
208
208
margin_right : usize ,
209
209
) {
210
210
let mut indent = indent;
211
- let bodys = opts:: create_opts_help ( cfgs, & mut indent) ;
211
+ let bodies = opts:: create_opts_help ( cfgs, & mut indent) ;
212
212
213
213
let mut max_len = 0 ;
214
- for ( i, _) in & bodys {
214
+ for ( i, _) in & bodies {
215
215
max_len = cmp:: max ( max_len, * i) ;
216
216
}
217
217
@@ -223,7 +223,7 @@ impl Help {
223
223
indent : indent,
224
224
margin_left : margin_left,
225
225
margin_right : margin_right,
226
- bodys : bodys ,
226
+ bodies : bodies ,
227
227
_spaces : " " . repeat ( max_len) ,
228
228
} ;
229
229
self . blocks . push ( block) ;
@@ -267,7 +267,7 @@ pub struct HelpIter<'a> {
267
267
}
268
268
269
269
struct BlockIter < ' a > {
270
- bodys : & ' a [ ( usize , String ) ] ,
270
+ bodies : & ' a [ ( usize , String ) ] ,
271
271
index : usize ,
272
272
indent : & ' a str ,
273
273
margin : & ' a str ,
@@ -295,14 +295,14 @@ impl Iterator for HelpIter<'_> {
295
295
impl < ' a > BlockIter < ' a > {
296
296
fn new ( block : & ' a Block , line_width : usize ) -> Self {
297
297
let print_width = line_width - block. margin_left - block. margin_right ;
298
- if block. bodys . is_empty ( ) || print_width <= block. indent {
298
+ if block. bodies . is_empty ( ) || print_width <= block. indent {
299
299
return Self :: empty ( ) ;
300
300
}
301
- let ( indent, text) = & block. bodys [ 0 ] ;
301
+ let ( indent, text) = & block. bodies [ 0 ] ;
302
302
let mut line_iter = linebreak:: LineIter :: new ( & text, print_width) ;
303
303
line_iter. set_indent ( & block. _spaces [ 0 ..( * indent) ] ) ;
304
304
Self {
305
- bodys : & block. bodys ,
305
+ bodies : & block. bodies ,
306
306
index : 0 ,
307
307
indent : & ( & block. _spaces ) [ 0 ..block. indent ] ,
308
308
margin : & ( & block. _spaces ) [ 0 ..block. margin_left ] ,
@@ -312,7 +312,7 @@ impl<'a> BlockIter<'a> {
312
312
313
313
fn empty ( ) -> Self {
314
314
Self {
315
- bodys : & [ ] as & ' a [ ( usize , String ) ] ,
315
+ bodies : & [ ] as & ' a [ ( usize , String ) ] ,
316
316
index : 0 ,
317
317
indent : "" ,
318
318
margin : "" ,
@@ -325,7 +325,7 @@ impl<'a> Iterator for BlockIter<'a> {
325
325
type Item = String ;
326
326
327
327
fn next ( & mut self ) -> Option < String > {
328
- if self . bodys . is_empty ( ) {
328
+ if self . bodies . is_empty ( ) {
329
329
return None ;
330
330
}
331
331
@@ -337,11 +337,11 @@ impl<'a> Iterator for BlockIter<'a> {
337
337
}
338
338
339
339
self . index += 1 ;
340
- if self . index >= self . bodys . len ( ) {
340
+ if self . index >= self . bodies . len ( ) {
341
341
break ;
342
342
}
343
343
344
- let ( indent, text) = & self . bodys [ self . index ] ;
344
+ let ( indent, text) = & self . bodies [ self . index ] ;
345
345
self . line_iter . init ( & text) ;
346
346
self . line_iter . set_indent ( & self . indent [ 0 ..( * indent) ] ) ;
347
347
}
0 commit comments