File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -236,10 +236,7 @@ macro_rules! create_config {
236
236
use std:: cmp;
237
237
let max = 0 ;
238
238
$( let max = cmp:: max( max, stringify!( $i) . len( ) +1 ) ; ) +
239
- let mut space_str = String :: with_capacity( max) ;
240
- for _ in 0 ..max {
241
- space_str. push( ' ' ) ;
242
- }
239
+ let space_str = " " . repeat( max) ;
243
240
writeln!( out, "Configuration Options:" ) . unwrap( ) ;
244
241
$(
245
242
if $stb || include_unstable {
Original file line number Diff line number Diff line change @@ -540,17 +540,12 @@ fn register_metavariable(
540
540
name : & str ,
541
541
dollar_count : usize ,
542
542
) {
543
- let mut new_name = String :: new ( ) ;
544
- let mut old_name = String :: new ( ) ;
543
+ let mut new_name = "$" . repeat ( dollar_count - 1 ) ;
544
+ let mut old_name = "$" . repeat ( dollar_count ) ;
545
545
546
- old_name. push ( '$' ) ;
547
- for _ in 0 ..( dollar_count - 1 ) {
548
- new_name. push ( '$' ) ;
549
- old_name. push ( '$' ) ;
550
- }
551
546
new_name. push ( 'z' ) ;
552
- new_name. push_str ( & name) ;
553
- old_name. push_str ( & name) ;
547
+ new_name. push_str ( name) ;
548
+ old_name. push_str ( name) ;
554
549
555
550
result. push_str ( & new_name) ;
556
551
map. insert ( old_name, new_name) ;
You can’t perform that action at this time.
0 commit comments