@@ -33,27 +33,33 @@ fn fail_derive(s: synstructure::Structure) -> TokenStream {
33
33
}
34
34
} ) ;
35
35
36
- let fail = s. unbound_impl ( quote ! ( :: failure:: Fail ) , quote ! {
37
- #[ allow( unreachable_code) ]
38
- fn cause( & self ) -> :: failure:: _core:: option:: Option <#make_dyn( :: failure:: Fail ) > {
39
- match * self { #cause_body }
40
- None
41
- }
36
+ let fail = s. unbound_impl (
37
+ quote ! ( :: failure:: Fail ) ,
38
+ quote ! {
39
+ #[ allow( unreachable_code) ]
40
+ fn cause( & self ) -> :: failure:: _core:: option:: Option <#make_dyn( :: failure:: Fail ) > {
41
+ match * self { #cause_body }
42
+ None
43
+ }
42
44
43
- #[ allow( unreachable_code) ]
44
- fn backtrace( & self ) -> :: failure:: _core:: option:: Option <& :: failure:: Backtrace > {
45
- match * self { #bt_body }
46
- None
47
- }
48
- } ) ;
49
- let display = display_body ( & s) . map ( |display_body| {
50
- s. unbound_impl ( quote ! ( :: failure:: _core:: fmt:: Display ) , quote ! {
51
45
#[ allow( unreachable_code) ]
52
- fn fmt ( & self , f : & mut :: failure:: _core:: fmt :: Formatter ) -> :: failure:: _core :: fmt :: Result {
53
- match * self { #display_body }
54
- write! ( f , "An error has occurred." )
46
+ fn backtrace ( & self ) -> :: failure:: _core:: option :: Option < & :: failure:: Backtrace > {
47
+ match * self { #bt_body }
48
+ None
55
49
}
56
- } )
50
+ } ,
51
+ ) ;
52
+ let display = display_body ( & s) . map ( |display_body| {
53
+ s. unbound_impl (
54
+ quote ! ( :: failure:: _core:: fmt:: Display ) ,
55
+ quote ! {
56
+ #[ allow( unreachable_code) ]
57
+ fn fmt( & self , f: & mut :: failure:: _core:: fmt:: Formatter ) -> :: failure:: _core:: fmt:: Result {
58
+ match * self { #display_body }
59
+ write!( f, "An error has occurred." )
60
+ }
61
+ } ,
62
+ )
57
63
} ) ;
58
64
59
65
( quote ! {
0 commit comments