File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -22,24 +22,26 @@ pub struct RunnerInfo {
22
22
23
23
impl RunnerInfo {
24
24
// This fuction is only meant to be called by the runners themselves hence this is not public
25
- fn try_from ( directory : & Path , executable : & Path ) -> Result < Self , Box < dyn std :: error :: Error > > {
25
+ fn try_from ( directory : & Path , executable : & Path ) -> Result < Self , Error > {
26
26
if !directory. exists ( ) {
27
- return Err ( Box :: new ( std:: io:: Error :: new (
27
+ return Err ( std:: io:: Error :: new (
28
28
std:: io:: ErrorKind :: NotFound ,
29
29
format ! ( "'{}' does not exist" , directory. display( ) ) ,
30
- ) ) ) ;
30
+ )
31
+ . into ( ) ) ;
31
32
}
32
33
let full_path = directory. join ( executable) ;
33
34
34
35
if !full_path. exists ( ) || !full_path. is_file ( ) {
35
- return Err ( Box :: new ( Error :: Io ( std:: io:: Error :: new (
36
+ return Err ( std:: io:: Error :: new (
36
37
std:: io:: ErrorKind :: NotFound ,
37
38
format ! (
38
39
"Executable '{}' not found in directory '{}'" ,
39
40
executable. display( ) ,
40
41
directory. display( )
41
42
) ,
42
- ) ) ) ) ;
43
+ )
44
+ . into ( ) ) ;
43
45
}
44
46
45
47
let name = directory
@@ -59,7 +61,7 @@ impl RunnerInfo {
59
61
ver
60
62
}
61
63
} )
62
- . map_err ( |e| Error :: Io ( e ) ) ?;
64
+ . map_err ( Error :: Io ) ?;
63
65
64
66
Ok ( RunnerInfo {
65
67
name,
You can’t perform that action at this time.
0 commit comments