Skip to content

Rust: ignore target in qltest #19542

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

Merged
merged 1 commit into from
May 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rust/extractor/src/qltest.rs
Original file line number Diff line number Diff line change
@@ -54,6 +54,7 @@ path = "main.rs"
fn set_sources(config: &mut Config) -> anyhow::Result<()> {
let path_iterator = glob("**/*.rs").context("globbing test sources")?;
config.inputs = path_iterator
.filter(|f| f.is_err() || !f.as_ref().unwrap().starts_with("target"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess your intention is to keep Err paths, right? So any errors are not silently ignored. If you just want to drop Err paths then it might be nicer to use f.is_ok_and() instead of the is_err check and unwrapping.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I hesitated between the two, but in the end opted for not suppressing the errors for now

.collect::<Result<Vec<_>, _>>()
.context("fetching test sources")?;
Ok(())