Skip to content

Commit cb9ab62

Browse files
Pzixelphimuemue
authored andcommitted
muse use collect result
1 parent 25c1eff commit cb9ab62

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2344,6 +2344,7 @@ pub trait Itertools: Iterator {
23442344

23452345
/// `.collect_vec()` is simply a type specialization of [`Iterator::collect`],
23462346
/// for convenience.
2347+
#[must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead"]
23472348
#[cfg(feature = "use_alloc")]
23482349
fn collect_vec(self) -> Vec<Self::Item>
23492350
where
@@ -2375,6 +2376,7 @@ pub trait Itertools: Iterator {
23752376
///
23762377
/// # let _ = do_stuff;
23772378
/// ```
2379+
#[must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead"]
23782380
fn try_collect<T, U, E>(self) -> Result<U, E>
23792381
where
23802382
Self: Sized + Iterator<Item = Result<T, E>>,

0 commit comments

Comments
 (0)