File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 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> {
8888}
8989
9090#[ 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 > {
9393 #[ derive( Debug ) ]
9494 struct StringError ( String ) ;
9595
@@ -103,7 +103,14 @@ impl<'a, 'b> From<&'b str> for Box<Error + Send + 'a> {
103103 }
104104 }
105105
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) )
107114 }
108115}
109116
You can’t perform that action at this time.
0 commit comments