mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.37k stars 306 forks source link

Look for config files next to input files #838

Closed jschwe closed 1 year ago

jschwe commented 1 year ago

Previously config files next to an explicit input file could not be picked up, since the from_root_or_default functions assumes the input path is a directory. This is the case for all other usages of the function, but in this case we know the input is a file, so we should determine the parent directory and look for the config file in that directory. There can't be a folder with the same name as the input file, so it's not possible that we won't pick up any files anymore that we previously did.