Skip to content

Commit 9fd7cc6

Browse files
committed
Fix: Hide internal detail only used in tests
Earlier it emitted dead_code warnings on the unused functions.
1 parent 38c0731 commit 9fd7cc6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gen/float_parts.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
/// <https://en.wikipedia.org/wiki/Double-precision_floating-point_format> and
77
/// <https://en.wikipedia.org/wiki/Single-precision_floating-point_format>
88
pub trait FloatParts: std::fmt::Debug {
9+
#[cfg(test)]
910
/// Max exponent value still being a finite (normal) number.
1011
fn exponent_normal_max() -> u16;
1112

13+
#[cfg(test)]
1214
/// Max fraction value still being a finite (normal) number.
1315
fn fraction_normal_max() -> u64;
1416

@@ -61,10 +63,12 @@ pub trait FloatParts: std::fmt::Debug {
6163
}
6264

6365
impl FloatParts for f32 {
66+
#[cfg(test)]
6467
fn exponent_normal_max() -> u16 {
6568
0xfe
6669
}
6770

71+
#[cfg(test)]
6872
fn fraction_normal_max() -> u64 {
6973
0x7fffff
7074
}
@@ -87,10 +91,12 @@ impl FloatParts for f32 {
8791
}
8892

8993
impl FloatParts for f64 {
94+
#[cfg(test)]
9095
fn exponent_normal_max() -> u16 {
9196
0x7fe
9297
}
9398

99+
#[cfg(test)]
94100
fn fraction_normal_max() -> u64 {
95101
0xfffffffffffff
96102
}

0 commit comments

Comments
 (0)