We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ba37a1 commit dacd94fCopy full SHA for dacd94f
src/encoder.rs
@@ -85,15 +85,15 @@ impl<H: Hasher> SdObjectEncoder<H> {
85
.get_mut(&mut self.object)
86
.map_err(|_| Error::InvalidPath(path.to_string()))?
87
.as_object_mut()
88
- .ok_or(Error::InvalidPath(path.to_string()))?;
+ .ok_or_else(|| Error::InvalidPath(path.to_string()))?;
89
90
// Remove the value from the parent and create a disclosure for it.
91
let disclosure = Disclosure::new(
92
salt,
93
Some(element_key.to_owned()),
94
parent
95
.remove(&element_key)
96
- .ok_or(Error::InvalidPath(path.to_string()))?,
+ .ok_or_else(|| Error::InvalidPath(path.to_string()))?,
97
);
98
99
// Hash the disclosure.
0 commit comments