Skip to content

Commit 2863a8b

Browse files
author
Robin Kruppe
committed
dec2flt: Simplify imports and module surface
The import has been unnecessarily complicated since ParseFloatError::Invalid is not longer used unqualified. The pfe_* functions do not need to be public any more since the only other use site, from_str_radix for floats, has been removed.
1 parent 6d87929 commit 2863a8b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/num/dec2flt/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ use fmt;
9797
use str::FromStr;
9898

9999
use self::parse::{parse_decimal, Decimal, Sign};
100-
use self::parse::ParseResult::{self, Valid, ShortcutToInf, ShortcutToZero};
100+
use self::parse::ParseResult::{Valid, Invalid, ShortcutToInf, ShortcutToZero};
101101
use self::num::digits_to_big;
102102
use self::rawfp::RawFloat;
103103

@@ -183,11 +183,11 @@ impl fmt::Display for ParseFloatError {
183183
}
184184
}
185185

186-
pub fn pfe_empty() -> ParseFloatError {
186+
fn pfe_empty() -> ParseFloatError {
187187
ParseFloatError { kind: FloatErrorKind::Empty }
188188
}
189189

190-
pub fn pfe_invalid() -> ParseFloatError {
190+
fn pfe_invalid() -> ParseFloatError {
191191
ParseFloatError { kind: FloatErrorKind::Invalid }
192192
}
193193

@@ -211,7 +211,7 @@ fn dec2flt<T: RawFloat>(s: &str) -> Result<T, ParseFloatError> {
211211
Valid(decimal) => try!(convert(decimal)),
212212
ShortcutToInf => T::infinity(),
213213
ShortcutToZero => T::zero(),
214-
ParseResult::Invalid => match s {
214+
Invalid => match s {
215215
"inf" => T::infinity(),
216216
"NaN" => T::nan(),
217217
_ => { return Err(pfe_invalid()); }

0 commit comments

Comments
 (0)