Repository: rust-bitcoin/rust-bitcoin (language: rust)

Issue:
Use stdlib `must_use` message
Change ` #[must_use = "returned iterator should be used"]` to be the same message that stdlib uses, something about iterators being lazy.

original comment: https://github.com/rust-bitcoin/rust-bitcoin/pull/3712#discussion_r1930853252


Discussion / hints:

Fix patch:
diff --git a/primitives/src/witness.rs b/primitives/src/witness.rs
index 4d0bb9bc5..abec3e1fb 100644
--- a/primitives/src/witness.rs
+++ b/primitives/src/witness.rs
@@ -103,7 +103,7 @@ impl Witness {
     pub fn is_empty(&self) -> bool { self.witness_elements == 0 }
 
     /// Returns a struct implementing [`Iterator`].
-    #[must_use = "returned iterator should be used"]
+    #[must_use = "iterators are lazy and do nothing unless consumed"]
     pub fn iter(&self) -> Iter {
         Iter { inner: self.content.as_slice(), indices_start: self.indices_start, current_index: 0 }
     }


Test patch: