From 4cfdb890ccaa0d48d5a13cd9440bfc98ab43a8f8 Mon Sep 17 00:00:00 2001 From: Psilon Date: Tue, 24 Dec 2024 09:08:26 +0200 Subject: [PATCH] muse use collect result --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 37c3b1f41..4acbbe112 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2299,6 +2299,7 @@ pub trait Itertools: Iterator { /// `.collect_vec()` is simply a type specialization of [`Iterator::collect`], /// for convenience. + #[must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead"] #[cfg(feature = "use_alloc")] fn collect_vec(self) -> Vec where @@ -2330,6 +2331,7 @@ pub trait Itertools: Iterator { /// /// # let _ = do_stuff; /// ``` + #[must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead"] fn try_collect(self) -> Result where Self: Sized + Iterator>,