Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CommitRewriter::rewrite_parents(): Take
IntoIterator
instead of `&[…
…CommitId]` This makes the API more flexible for cases where the caller doesn't already have a Vec or array of owned CommitIds. CommitIds are often manipulated by reference, so this makes the API more useable in many practical cases. In many cases `rewrite_parents()` does not even need to clone the input CommitIds. This refactor allows the clone to be avoided if it's unnecessary. There might be other APIs that would benefit from a similar change. In general, it seems like there are a lot of places where we're writing `&[commit_x.id().clone, commit_y.id().clone()]` and similiar. - [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/flexibility.html#functions-minimize-assumptions-about-parameters-by-using-generics-c-generic)
- Loading branch information