Skip to content
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

Exclude based on regex of statements? #301

Open
sourcefrog opened this issue Mar 3, 2024 · 0 comments
Open

Exclude based on regex of statements? #301

sourcefrog opened this issue Mar 3, 2024 · 0 comments
Labels
filter About filtering, and selecting mutants

Comments

@sourcefrog
Copy link
Owner

let mut r = String::with_capacity(s.len() + replacement.len());

The String::with_capacity isn't wrong, and it's probably slightly beneficial to have there, but the side effects are subtle and it's probably asking too much to test it. (Actually, in this specific case we could debug_assert the capacity to shush it, but that's a bit messy.)

We cannot yet add a #[mutants::skip] here, because expression attributes aren't stable yet (rust-lang/rust#15701).

Maybe it would be useful to have config that can match against the whole expression text and then skip; that would probably help in other cases of code that only has unimportant side effects such as trace statements.

@sourcefrog sourcefrog added the filter About filtering, and selecting mutants label Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filter About filtering, and selecting mutants
Projects
None yet
Development

No branches or pull requests

1 participant