File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -365,6 +365,20 @@ impl<E> TranslateErr<E> {
365365 }
366366}
367367
368+ impl TranslateErr < core:: convert:: Infallible > {
369+ /// Remove the impossible "translator error" case and return a context error.
370+ ///
371+ /// When the translator error type is [`core::convert::Infallible`], which is
372+ /// impossible to construct, allows unwrapping the outer error without any
373+ /// panic paths.
374+ pub fn into_outer_err ( self ) -> Error {
375+ match self {
376+ Self :: TranslatorErr ( impossible) => match impossible { } ,
377+ Self :: OuterError ( e) => e,
378+ }
379+ }
380+ }
381+
368382impl TranslateErr < Error > {
369383 /// If we are doing a translation where our "outer error" is the generic
370384 /// Miniscript error, eliminate the `TranslateErr` type which is just noise.
You can’t perform that action at this time.
0 commit comments