Skip to content

Commit

Permalink
Revert finding cbindgen.toml logic change
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwe committed May 29, 2023
1 parent d98c635 commit b5ab006
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/main.rs
Expand Up @@ -84,18 +84,7 @@ fn load_bindings(input: &Path, matches: &ArgMatches) -> Result<Bindings, Error>
// Load any config specified or search in the input directory
let mut config = match matches.value_of("config") {
Some(c) => Config::from_file(c).unwrap(),
None => {
// In contrast to `Config::from_root_or_default` we look for
// cbindgen.toml next to the current _file_. There is always
// a parent (at the very least the root), so unwrapping is fine.
let c = input.parent().unwrap().join("cbindgen.toml");

if c.exists() {
Config::from_file(&c).unwrap()
} else {
Config::default()
}
}
None => Config::from_root_or_default(input),
};

apply_config_overrides(&mut config, matches);
Expand Down

0 comments on commit b5ab006

Please sign in to comment.