Omit size_hint::cautious when not allocating

This commit is contained in:
David Tolnay
2021-01-24 20:24:03 -08:00
parent 38edb473de
commit 74ca06662e
+1
View File
@@ -7,6 +7,7 @@ where
helper(iter.size_hint())
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[inline]
pub fn cautious(hint: Option<usize>) -> usize {
cmp::min(hint.unwrap_or(0), 4096)