@@ -10,7 +10,6 @@ use crate::mem;
10
10
use crate :: num:: flt2dec;
11
11
use crate :: ops:: Deref ;
12
12
use crate :: result;
13
- use crate :: slice;
14
13
use crate :: str;
15
14
16
15
mod builders;
@@ -234,7 +233,6 @@ pub struct Formatter<'a> {
234
233
precision : Option < usize > ,
235
234
236
235
buf : & ' a mut ( dyn Write + ' a ) ,
237
- curarg : slice:: Iter < ' a , ArgumentV1 < ' a > > ,
238
236
args : & ' a [ ArgumentV1 < ' a > ] ,
239
237
}
240
238
@@ -1044,7 +1042,6 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
1044
1042
align : rt:: v1:: Alignment :: Unknown ,
1045
1043
fill : ' ' ,
1046
1044
args : args. args ,
1047
- curarg : args. args . iter ( ) ,
1048
1045
} ;
1049
1046
1050
1047
let mut idx = 0 ;
@@ -1117,7 +1114,6 @@ impl<'a> Formatter<'a> {
1117
1114
1118
1115
// These only exist in the struct for the `run` method,
1119
1116
// which won’t be used together with this method.
1120
- curarg : self . curarg . clone ( ) ,
1121
1117
args : self . args ,
1122
1118
}
1123
1119
}
@@ -1134,9 +1130,17 @@ impl<'a> Formatter<'a> {
1134
1130
self . precision = self . getcount ( & arg. format . precision ) ;
1135
1131
1136
1132
// Extract the correct argument
1137
- let value = match arg. position {
1138
- rt:: v1:: Position :: Next => * self . curarg . next ( ) . unwrap ( ) ,
1139
- rt:: v1:: Position :: At ( i) => self . args [ i] ,
1133
+ let value = {
1134
+ #[ cfg( bootstrap) ]
1135
+ {
1136
+ match arg. position {
1137
+ rt:: v1:: Position :: At ( i) => self . args [ i] ,
1138
+ }
1139
+ }
1140
+ #[ cfg( not( bootstrap) ) ]
1141
+ {
1142
+ self . args [ arg. position ]
1143
+ }
1140
1144
} ;
1141
1145
1142
1146
// Then actually do some printing
@@ -1148,7 +1152,6 @@ impl<'a> Formatter<'a> {
1148
1152
rt:: v1:: Count :: Is ( n) => Some ( n) ,
1149
1153
rt:: v1:: Count :: Implied => None ,
1150
1154
rt:: v1:: Count :: Param ( i) => self . args [ i] . as_usize ( ) ,
1151
- rt:: v1:: Count :: NextParam => self . curarg . next ( ) ?. as_usize ( ) ,
1152
1155
}
1153
1156
}
1154
1157
0 commit comments