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> {
365
365
}
366
366
}
367
367
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
+
368
382
impl TranslateErr < Error > {
369
383
/// If we are doing a translation where our "outer error" is the generic
370
384
/// Miniscript error, eliminate the `TranslateErr` type which is just noise.
You can’t perform that action at this time.
0 commit comments