We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
size_hint::pow_scalar_base
1 parent 75ead8e commit 4671345Copy full SHA for 4671345
src/size_hint.rs
@@ -3,7 +3,6 @@
3
4
use std::usize;
5
use std::cmp;
6
-use std::u32;
7
8
/// `SizeHint` is the return type of `Iterator::size_hint()`.
9
pub type SizeHint = (usize, Option<usize>);
@@ -75,21 +74,6 @@ pub fn mul_scalar(sh: SizeHint, x: usize) -> SizeHint {
75
74
(low, hi)
76
}
77
78
-/// Raise `base` correctly by a `SizeHint` exponent.
79
-#[inline]
80
-#[allow(dead_code)]
81
-pub fn pow_scalar_base(base: usize, exp: SizeHint) -> SizeHint {
82
- let exp_low = cmp::min(exp.0, u32::MAX as usize) as u32;
83
- let low = base.saturating_pow(exp_low);
84
-
85
- let hi = exp.1.and_then(|exp| {
86
- let exp_hi = cmp::min(exp, u32::MAX as usize) as u32;
87
- base.checked_pow(exp_hi)
88
- });
89
90
- (low, hi)
91
-}
92
93
/// Return the maximum
94
#[inline]
95
pub fn max(a: SizeHint, b: SizeHint) -> SizeHint {
0 commit comments