diff options
author | Stefan Kreutz <mail@skreutz.com> | 2022-12-19 12:08:20 +0100 |
---|---|---|
committer | Stefan Kreutz <mail@skreutz.com> | 2022-12-19 12:08:20 +0100 |
commit | 9f83f904d490e64306f1f288234221aab9d57dd9 (patch) | |
tree | 5247dbbf4e28cfe8a6d35c0608d4951a4723c4b5 /src/lib.rs | |
parent | f2181e1c8d55d4da0e298685f7805ae0c17cf6ae (diff) | |
download | parseq-9f83f904d490e64306f1f288234221aab9d57dd9.tar |
Add must_use attribute to iterator trait and impl
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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, |