diff --git a/tower/src/lib.rs b/tower/src/lib.rs index 179edfbec..ce911e9d8 100644 --- a/tower/src/lib.rs +++ b/tower/src/lib.rs @@ -219,6 +219,7 @@ pub use tower_layer::Layer; pub use tower_service::Service; #[allow(unreachable_pub)] +#[cfg(any(feature = "balance", feature = "discover", feature = "make"))] mod sealed { pub trait Sealed {} } diff --git a/tower/src/util/rng.rs b/tower/src/util/rng.rs index 9b6d307d9..5b2f9fce7 100644 --- a/tower/src/util/rng.rs +++ b/tower/src/util/rng.rs @@ -116,6 +116,7 @@ where /// /// ref: This was borrowed and modified from the following Rand implementation /// https://github.com/rust-random/rand/blob/b73640705d6714509f8ceccc49e8df996fa19f51/src/seq/index.rs#L375-L411 +#[cfg(feature = "balance")] pub(crate) fn sample_floyd2(rng: &mut R, length: u64) -> [u64; 2] { debug_assert!(2 <= length); let aidx = rng.next_range(0..length - 1);