File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
branches/try/src/libcore/fmt Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: f8f2c7a9537c7f333b242f616aefb75a83860927
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
5
- refs/heads/try: 5579692ce77df5f8227ab7a226145f7cf18ef747
5
+ refs/heads/try: c7b6eb38ff14b7225b7ccb86f9a2080fdba4a3e0
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
8
8
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ use fmt;
20
20
use iter:: { range, DoubleEndedIteratorExt } ;
21
21
use num:: { Float , FPNaN , FPInfinite , ToPrimitive } ;
22
22
use num:: cast;
23
+ use ops:: FnOnce ;
23
24
use result:: Result :: Ok ;
24
25
use slice:: { mod, SlicePrelude } ;
25
26
use str:: StrPrelude ;
@@ -84,16 +85,18 @@ static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11u;
84
85
/// between digit and exponent sign `'e'`.
85
86
/// - Panics if `radix` > 25 and `exp_format` is `ExpBin` due to conflict
86
87
/// between digit and exponent sign `'p'`.
87
- pub fn float_to_str_bytes_common < T : Float , U > (
88
+ pub fn float_to_str_bytes_common < T : Float , U , F > (
88
89
num : T ,
89
90
radix : uint ,
90
91
negative_zero : bool ,
91
92
sign : SignFormat ,
92
93
digits : SignificantDigits ,
93
94
exp_format : ExponentFormat ,
94
95
exp_upper : bool ,
95
- f: |& [ u8] | -> U
96
- ) -> U {
96
+ f : F
97
+ ) -> U where
98
+ F : FnOnce ( & [ u8 ] ) -> U ,
99
+ {
97
100
assert ! ( 2 <= radix && radix <= 36 ) ;
98
101
match exp_format {
99
102
ExpDec if radix >= DIGIT_E_RADIX // decimal exponent 'e'
You can’t perform that action at this time.
0 commit comments