diff --git a/src/buf/buf_impl.rs b/src/buf/buf_impl.rs index 3eda3dfd0..286cdf9df 100644 --- a/src/buf/buf_impl.rs +++ b/src/buf/buf_impl.rs @@ -1,7 +1,9 @@ #[cfg(feature = "std")] use crate::buf::{reader, Reader}; use crate::buf::{take, Chain, Take}; -use crate::{min_u64_usize, panic_advance, panic_does_not_fit, saturating_sub_usize_u64}; +#[cfg(feature = "std")] +use crate::{min_u64_usize, saturating_sub_usize_u64}; +use crate::{panic_advance, panic_does_not_fit}; #[cfg(feature = "std")] use std::io::IoSlice; diff --git a/src/lib.rs b/src/lib.rs index 3e627f81a..ead1ae947 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -117,6 +117,7 @@ fn abort() -> ! { } #[inline(always)] +#[cfg(feature = "std")] fn saturating_sub_usize_u64(a: usize, b: u64) -> usize { use core::convert::TryFrom; match usize::try_from(b) { @@ -126,6 +127,7 @@ fn saturating_sub_usize_u64(a: usize, b: u64) -> usize { } #[inline(always)] +#[cfg(feature = "std")] fn min_u64_usize(a: u64, b: usize) -> usize { use core::convert::TryFrom; match usize::try_from(a) {