Skip to content

Commit

Permalink
build: power_scalar_base behind no_alloc feature
Browse files Browse the repository at this point in the history
Co-authored-by: Shahar "Dawn" Or <[email protected]>
  • Loading branch information
warren2k and mightyiam committed Aug 19, 2023
1 parent ee0a550 commit cee3b84
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/size_hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use std::usize;
use std::cmp;
#[cfg(feature = "use_alloc")]
use std::u32;

/// `SizeHint` is the return type of `Iterator::size_hint()`.
Expand Down Expand Up @@ -76,6 +77,7 @@ pub fn mul_scalar(sh: SizeHint, x: usize) -> SizeHint {
}

/// Raise `base` correctly by a `SizeHint` exponent.
#[cfg(feature = "use_alloc")]
#[inline]
pub fn pow_scalar_base(base: usize, exp: SizeHint) -> SizeHint {
let exp_low = cmp::min(exp.0, u32::MAX as usize) as u32;
Expand Down

0 comments on commit cee3b84

Please sign in to comment.