File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,8 @@ impl<'a, E: Error + Send + 'a> From<E> for Box<Error + Send + 'a> {
88
88
}
89
89
90
90
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
91
- impl < ' a , ' b > From < & ' b str > for Box < Error + Send + ' a > {
92
- fn from ( err : & ' b str ) -> Box < Error + Send + ' a > {
91
+ impl From < String > for Box < Error + Send > {
92
+ fn from ( err : String ) -> Box < Error + Send > {
93
93
#[ derive( Debug ) ]
94
94
struct StringError ( String ) ;
95
95
@@ -103,7 +103,14 @@ impl<'a, 'b> From<&'b str> for Box<Error + Send + 'a> {
103
103
}
104
104
}
105
105
106
- Box :: new ( StringError ( String :: from_str ( err) ) )
106
+ Box :: new ( StringError ( err) )
107
+ }
108
+ }
109
+
110
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
111
+ impl < ' a , ' b > From < & ' b str > for Box < Error + Send + ' a > {
112
+ fn from ( err : & ' b str ) -> Box < Error + Send + ' a > {
113
+ From :: from ( String :: from_str ( err) )
107
114
}
108
115
}
109
116
You can’t perform that action at this time.
0 commit comments