File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -231,12 +231,12 @@ impl Asset {
231231 }
232232 }
233233
234- /// Unwrap the explicit value of this type .
235- /// Panics if [is_explicit] returns false.
236- pub fn unwrap_explicit ( & self ) -> sha256d:: Hash {
234+ /// Returns the explicit asset .
235+ /// Returns [None] if [is_explicit] returns false.
236+ pub fn explicit ( & self ) -> Option < sha256d:: Hash > {
237237 match * self {
238- Asset :: Explicit ( v) => v ,
239- _ => panic ! ( "Called unwrap_explicit on non-explicit asset: {:?}" , self ) ,
238+ Asset :: Explicit ( v) => Some ( v ) ,
239+ _ => None ,
240240 }
241241 }
242242}
@@ -274,12 +274,12 @@ impl Nonce {
274274 }
275275 }
276276
277- /// Unwrap the explicit value of this type .
278- /// Panics if [is_explicit] returns false.
279- pub fn unwrap_explicit ( & self ) -> sha256d:: Hash {
277+ /// Returns the explicit nonce .
278+ /// Returns [None] if [is_explicit] returns false.
279+ pub fn explicit ( & self ) -> Option < sha256d:: Hash > {
280280 match * self {
281- Nonce :: Explicit ( v) => v ,
282- _ => panic ! ( "Called unwrap_explicit on non-explicit nonce: {:?}" , self ) ,
281+ Nonce :: Explicit ( v) => Some ( v ) ,
282+ _ => None ,
283283 }
284284 }
285285}
You can’t perform that action at this time.
0 commit comments