diff options
author | Joel Galenson <jgalenson@google.com> | 2021-04-01 17:03:06 -0700 |
---|---|---|
committer | Joel Galenson <jgalenson@google.com> | 2021-04-01 17:03:06 -0700 |
commit | 6f798715de3d4bd744116190d14a413445542820 (patch) | |
tree | 70e883bc01ba2b4d8dd07e0347be18a2fbbd2c18 /src/adaptors/multi_product.rs | |
parent | a06122cf145ade58c23ae76bcf31d9c748dce354 (diff) | |
download | itertools-6f798715de3d4bd744116190d14a413445542820.tar.gz |
Upgrade rust/crates/itertools to 0.10.0android-s-beta-2android-s-beta-1
Test: make
Change-Id: Ie8b53cb0a96fd9adcbf7f4afa3b966849fc2ff24
Diffstat (limited to 'src/adaptors/multi_product.rs')
-rw-r--r-- | src/adaptors/multi_product.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/adaptors/multi_product.rs b/src/adaptors/multi_product.rs index 4a31713..6938014 100644 --- a/src/adaptors/multi_product.rs +++ b/src/adaptors/multi_product.rs @@ -1,8 +1,10 @@ -#![cfg(feature = "use_std")] +#![cfg(feature = "use_alloc")] use crate::size_hint; use crate::Itertools; +use alloc::vec::Vec; + #[derive(Clone)] /// An iterator adaptor that iterates over the cartesian product of /// multiple iterators of type `I`. @@ -161,7 +163,7 @@ impl<I> Iterator for MultiProduct<I> } fn count(self) -> usize { - if self.0.len() == 0 { + if self.0.is_empty() { return 0; } @@ -183,7 +185,7 @@ impl<I> Iterator for MultiProduct<I> fn size_hint(&self) -> (usize, Option<usize>) { // Not ExactSizeIterator because size may be larger than usize - if self.0.len() == 0 { + if self.0.is_empty() { return (0, Some(0)); } |