File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use clap::error::{Error, ErrorKind};
8
8
use clap:: { CommandFactory , Parser } ;
9
9
use std:: fs:: File ;
10
10
use std:: io;
11
+ use std:: io:: { Error as IoError , ErrorKind as IoErrorKind } ;
11
12
use std:: path:: { Path , PathBuf } ;
12
13
use std:: process:: exit;
13
14
@@ -95,7 +96,7 @@ fn parse_custom_derive(
95
96
) ]
96
97
struct BindgenCommand {
97
98
/// C or C++ header file.
98
- header : String ,
99
+ header : Option < String > ,
99
100
/// Path to write depfile to.
100
101
#[ arg( long) ]
101
102
depfile : Option < String > ,
@@ -589,7 +590,11 @@ where
589
590
590
591
let mut builder = builder ( ) ;
591
592
592
- builder = builder. header ( header) ;
593
+ if let Some ( header) = header {
594
+ builder = builder. header ( header) ;
595
+ } else {
596
+ return Err ( IoError :: new ( IoErrorKind :: Other , "Header not found" ) ) ;
597
+ }
593
598
594
599
if let Some ( rust_target) = rust_target {
595
600
builder = builder. rust_target ( rust_target) ;
You can’t perform that action at this time.
0 commit comments