Skip to content

Commit ab90b49

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 164769 b: refs/heads/try c: c7b6eb3 h: refs/heads/master i: 164767: 0e956c7 v: v3
1 parent 73025bd commit ab90b49

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: f8f2c7a9537c7f333b242f616aefb75a83860927
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
5-
refs/heads/try: 5579692ce77df5f8227ab7a226145f7cf18ef747
5+
refs/heads/try: c7b6eb38ff14b7225b7ccb86f9a2080fdba4a3e0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcore/fmt/float.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use fmt;
2020
use iter::{range, DoubleEndedIteratorExt};
2121
use num::{Float, FPNaN, FPInfinite, ToPrimitive};
2222
use num::cast;
23+
use ops::FnOnce;
2324
use result::Result::Ok;
2425
use slice::{mod, SlicePrelude};
2526
use str::StrPrelude;
@@ -84,16 +85,18 @@ static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11u;
8485
/// between digit and exponent sign `'e'`.
8586
/// - Panics if `radix` > 25 and `exp_format` is `ExpBin` due to conflict
8687
/// 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>(
8889
num: T,
8990
radix: uint,
9091
negative_zero: bool,
9192
sign: SignFormat,
9293
digits: SignificantDigits,
9394
exp_format: ExponentFormat,
9495
exp_upper: bool,
95-
f: |&[u8]| -> U
96-
) -> U {
96+
f: F
97+
) -> U where
98+
F: FnOnce(&[u8]) -> U,
99+
{
97100
assert!(2 <= radix && radix <= 36);
98101
match exp_format {
99102
ExpDec if radix >= DIGIT_E_RADIX // decimal exponent 'e'

0 commit comments

Comments
 (0)