Skip to content

Commit 1bb23ad

Browse files
committed
Remove format_u8 when not used by Ipv4Addr impl
1 parent 9be4c96 commit 1bb23ad

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎serde/src/ser/impls.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,13 +674,15 @@ impl Serialize for net::IpAddr {
674674
}
675675
}
676676

677+
#[cfg(feature = "std")]
677678
const DEC_DIGITS_LUT: &'static [u8] = b"\
678679
0001020304050607080910111213141516171819\
679680
2021222324252627282930313233343536373839\
680681
4041424344454647484950515253545556575859\
681682
6061626364656667686970717273747576777879\
682683
8081828384858687888990919293949596979899";
683684

685+
#[cfg(feature = "std")]
684686
#[inline]
685687
fn format_u8(mut n: u8, out: &mut [u8]) -> usize {
686688
if n >= 100 {
@@ -701,6 +703,7 @@ fn format_u8(mut n: u8, out: &mut [u8]) -> usize {
701703
}
702704
}
703705

706+
#[cfg(feature = "std")]
704707
#[test]
705708
fn test_format_u8() {
706709
for i in 0..(u8::MAX as u16) {

0 commit comments

Comments
 (0)