File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1- use std:: error:: Error ;
1+ use std:: error:: Error as StdError ;
22use std:: io;
33use thiserror:: Error ;
44
@@ -20,7 +20,7 @@ pub struct ExplicitSource {
2020#[ error( "boxed source" ) ]
2121pub struct BoxedSource {
2222 #[ source]
23- source : Box < dyn Error + Send + ' static > ,
23+ source : Box < dyn StdError + Send + ' static > ,
2424}
2525
2626#[ test]
@@ -42,8 +42,7 @@ fn test_explicit_source() {
4242
4343#[ test]
4444fn test_boxed_source ( ) {
45- let io = io:: Error :: new ( io:: ErrorKind :: Other , "oh no!" ) ;
46- let _error = BoxedSource {
47- source : Box :: new ( io) ,
48- } ;
45+ let source = Box :: new ( io:: Error :: new ( io:: ErrorKind :: Other , "oh no!" ) ) ;
46+ let error = BoxedSource { source } ;
47+ error. source ( ) . unwrap ( ) . downcast_ref :: < io:: Error > ( ) . unwrap ( ) ;
4948}
You can’t perform that action at this time.
0 commit comments