mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-22 07:33:47 -07:00
For users of globset who already have a `Vec<Glob>` (or similar), the current API requires them to iterate over their `Vec<Glob>`, calling `GlobSetBuilder::add` for each `Glob`, thus constructing a new `Vec<Glob>` internal to the GlobSetBuilder. This makes the consuming code unnecessarily verbose. (There is unlikely to be any meaningful performance impact of this, however, since the cost of allocating a new `Vec` is likely marginal compared to the cost of glob compilation.) Instead of taking a `&[Glob]`, we accept an iterator of anything that can be borrowed as a `&Glob`. This required some light refactoring of the constructor, but nothing onerous. Closes #3066