Skip to content

Commit 86a55e3

Browse files
authored
Add #[must_use] to HashAdd trait methods (#245)
1 parent 5a3424f commit 86a55e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

secp256kfun/src/hash.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ impl<T: HashInto + Ord> HashInto for alloc::collections::BTreeSet<T> {
162162
/// Extension trait for [`digest::Update`] to make adding things to the hash convenient.
163163
pub trait HashAdd {
164164
/// Converts something that implements [`HashInto`] to bytes and then incorporate the result into the digest (`self`).
165+
#[must_use]
165166
fn add<HI: HashInto>(self, data: HI) -> Self;
166167

167168
/// Adds a domain separator to the hash. This works to make sure the results
@@ -171,6 +172,7 @@ pub trait HashAdd {
171172
/// ## Panics
172173
///
173174
/// If the length of `domain_separator` is greater than 255.
175+
#[must_use]
174176
fn ds(self, domain_separator: &'static str) -> Self
175177
where
176178
Self: Sized,
@@ -185,6 +187,7 @@ pub trait HashAdd {
185187
/// ## Panics
186188
///
187189
/// If the total byte length of the `separators` is greater than 255.
190+
#[must_use]
188191
fn ds_vectored(self, separators: &[&'static str]) -> Self
189192
where
190193
Self: Sized,

0 commit comments

Comments
 (0)