-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify #3798
Simplify #3798
Changes from all commits
4b2bf9c
b7d5172
987fb26
a90401a
bef899a
6190cae
c0cf60d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,10 +29,14 @@ impl RustPackageFilterBuilder { | |
self.is_member = is_member; | ||
self | ||
} | ||
pub fn exclude(mut self, glob: Glob) -> RustPackageFilterBuilder { | ||
self.exclude.add(glob); | ||
|
||
pub fn exclude(mut self, globs: impl IntoIterator<Item = Glob>) -> RustPackageFilterBuilder { | ||
for glob in globs.into_iter() { | ||
self.exclude.add(glob); | ||
} | ||
self | ||
} | ||
|
||
pub fn into_vfs_filter(self) -> Box<dyn Filter> { | ||
let RustPackageFilterBuilder { is_member, mut exclude } = self; | ||
for &glob in ALWAYS_IGNORED { | ||
|
@@ -87,7 +91,7 @@ fn test_globs() { | |
|
||
let filter = RustPackageFilterBuilder::default() | ||
.set_member(true) | ||
.exclude(Glob::new("src/llvm-project/**").unwrap()) | ||
.exclude(std::iter::once(Glob::new("src/llvm-project/**").unwrap())) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the way, this also works since .exclude(Some(Glob::new("src/llvm-project/**").unwrap())) But it looks very hacky :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, there is not into_iter for
This comment was marked as resolved.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
.into_vfs_filter(); | ||
|
||
assert!(!filter.include_dir(RelativePath::new("src/llvm-project/clang"))); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better name is
new_foreign
?