@@ -6,10 +6,10 @@ use std::env;
6
6
use std:: fs;
7
7
use std:: io:: { BufReader , BufRead , Read , Write } ;
8
8
use std:: path:: { Path , PathBuf } ;
9
- use std:: process:: { Command , ExitStatus } ;
9
+ use std:: process:: Command ;
10
10
use tempdir:: TempDir ;
11
11
12
- fn test_generated_bindings ( header : & PathBuf , output : & str ) -> Result < ExitStatus , std :: io :: Error > {
12
+ fn test_generated_bindings ( header : & PathBuf , output : & str ) -> Result < ( ) , ( ) > {
13
13
let temp_dir = TempDir :: new ( "bindgen-tests" )
14
14
. expect ( "Couldn't create temp dir" ) ;
15
15
@@ -25,11 +25,11 @@ fn test_generated_bindings(header: &PathBuf, output: &str) -> Result<ExitStatus,
25
25
binary. set_extension ( "bin" ) ;
26
26
27
27
let mut file = fs:: File :: create ( & source) . expect ( "Couldn't create output source file" ) ;
28
- try! ( file. write_all ( output. as_bytes ( ) ) ) ;
28
+ file. write_all ( output. as_bytes ( ) ) . expect ( "Couldn't write to output source file" ) ;
29
29
30
- Command :: new ( "rustc" )
30
+ let output = Command :: new ( "rustc" )
31
31
. arg ( "--test" )
32
- . arg ( source)
32
+ . arg ( & source)
33
33
. arg ( "-o" )
34
34
. arg ( binary)
35
35
. output ( ) ;
@@ -68,7 +68,7 @@ fn spawn_bindgen(header: &PathBuf, builder: libbindgen::Builder) -> Result<(), (
68
68
. expect ( "Couldn't read from expected test output" ) ;
69
69
70
70
if output == buffer {
71
- test_generated_bindings ( & header, & output) . and ( Ok ( ( ) ) ) . or ( Err ( ( ) ) )
71
+ test_generated_bindings ( & header, & output)
72
72
} else {
73
73
println ! ( "diff expected generated\n --- expected: {:?}\n +++ generated from: {:?}" ,
74
74
expected, header) ;
0 commit comments