Don't generate a mutation for .with_capacity
#315
Labels
enhancement
New feature or request
generate
Patterns of mutation
good first issue
Good for newcomers
Discussed in #314
Originally posted by pashadia March 21, 2024
Hi all,
New contributor here, first of all congratulations on a great project!
I've used
cargo mutants
on a fairly large codebase (12kloc). One of the things that appear regularly on my project is to preallocate memory for some data structures. For instance, we use things likelet v = Vec::with_capacity(a+b);
. Obviously,cargo-mutants
is generating a mutation for the argument, into things likea-b
ora*b
. However, this won't break any tests, as it doesn't actually introduce a bug in functionality, only the memory allocation footprint may be different.My proposal is to remove the generation of mutations for the
.with_capacity
parameter, for all the structs instd::collections
, and perhaps not only. I would gladly attempt an implementation, if this proposal is well received.skip_calls: Vec<String>
with_capacity
The text was updated successfully, but these errors were encountered: