Skip to content

Commit

Permalink
Merge rust-bitcoin#3966: Change #[must_use] to be the same as stdlib
Browse files Browse the repository at this point in the history
cb5ffde Change `#[must_use]` to be the same as stdlib (Jamil Lambert, PhD)

Pull request description:

  Change the iterator `#[must_use]` message to be the same as stdlib uses.

  Message taken from https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#38

  Close rust-bitcoin#3962

ACKs for top commit:
  Kixunil:
    ACK cb5ffde
  tcharding:
    ACK cb5ffde

Tree-SHA512: 4866d9bddccdc28e2ba2b15cb4041851abb1512cea0317f20d2e2306df6dcd1addb828d61a84a2083d3ef47abb5cf9276e857cf098de2d28b4706ecd0a1f24fa
  • Loading branch information
apoelstra committed Jan 28, 2025
2 parents b99a81a + cb5ffde commit 28b867d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion primitives/src/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
Expand Down

0 comments on commit 28b867d

Please sign in to comment.