Skip to content

Commit ac3d37e

Browse files
committed
Use name instead of absolute path for checking allow/blocklist.
1 parent 524bb5e commit ac3d37e

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

bindgen/ir/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2509,7 +2509,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
25092509
if self
25102510
.options()
25112511
.allowlisted_files
2512-
.matches(file.path().display().to_string())
2512+
.matches(file.name())
25132513
{
25142514
return true;
25152515
}

bindgen/ir/item.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,7 @@ impl Item {
642642

643643
if !ctx.options().blocklisted_files.is_empty() {
644644
if let Some(SourceLocation::File { file, .. }) = &self.location {
645-
if ctx
646-
.options()
647-
.blocklisted_files
648-
.matches(file.path().display().to_string())
649-
{
645+
if ctx.options().blocklisted_files.matches(file.name()) {
650646
return true;
651647
}
652648
}

0 commit comments

Comments
 (0)