File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -214,17 +214,19 @@ pub mod ct {
214
214
err: ErrorFn) ->
215
215
Parsed<Piece> {
216
216
let parm = parse_parameter(s, i, lim);
217
- let flags = parse_flags(s, parm.next, lim);
218
- let width = parse_count(s, flags.next, lim);
217
+ // avoid copying ~[Flag] by destructuring
218
+ let Parsed {val: flags_val, next: flags_next} = parse_flags(s,
219
+ parm.next, lim);
220
+ let width = parse_count(s, flags_next, lim);
219
221
let prec = parse_precision(s, width.next, lim);
220
222
let ty = parse_type(s, prec.next, lim, err);
221
- return Parsed::new(
223
+ Parsed::new(
222
224
PieceConv(Conv {param: parm.val,
223
- flags: copy flags.val ,
225
+ flags: flags_val ,
224
226
width: width.val,
225
227
precision: prec.val,
226
228
ty: ty.val}),
227
- ty.next);
229
+ ty.next)
228
230
}
229
231
pub fn parse_parameter(s: &str, i: uint, lim: uint) ->
230
232
Parsed<Option<uint>> {
You can’t perform that action at this time.
0 commit comments