summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kreutz <mail@skreutz.com>2022-12-19 12:08:20 +0100
committerStefan Kreutz <mail@skreutz.com>2022-12-19 12:08:20 +0100
commit9f83f904d490e64306f1f288234221aab9d57dd9 (patch)
tree5247dbbf4e28cfe8a6d35c0608d4951a4723c4b5
parentf2181e1c8d55d4da0e298685f7805ae0c17cf6ae (diff)
downloadparseq-9f83f904d490e64306f1f288234221aab9d57dd9.tar
Add must_use attribute to iterator trait and impl
-rw-r--r--src/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 3442f58..7022d37 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -42,6 +42,7 @@ use std::{collections::HashMap, num::NonZeroUsize};
use crossbeam_channel::{Receiver, Select, Sender, TryRecvError};
/// An extension trait adding parallel sequential mapping to the standard [`Iterator`] trait.
+#[must_use = "iterators are lazy and do nothing unless consumed"]
pub trait ParallelIterator {
/// Creates an iterator which applies a given closure to each element in parallel.
///
@@ -146,6 +147,7 @@ impl<I> ParallelIterator for I where I: Iterator {}
///
/// This struct is created by the [`map_parallel`](ParallelIterator::map_parallel) method on the
/// [`ParallelIterator`] trait.
+#[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct ParallelMap<I, B>
where
I: Iterator,
Generated by cgit. See skreutz.com for my tech blog and contact information.