From a3828579fbe916e68dc8a60d86cb309567a71845 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sun, 1 Oct 2023 20:59:46 +0200 Subject: [PATCH] fix features --- src/buf/buf_impl.rs | 4 +++- src/lib.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) 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) {