ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/lib
Evan Mesterhazy 2b0aa84c9d CommitRewriter::rewrite_parents(): Take IntoIterator instead of &[CommitId]
CommitIds are often manipulated by reference, so this makes the API more
flexible for cases where the caller doesn't already have a Vec or array of
owned CommitIds.

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)
2024-04-21 23:31:17 -04:00
..
benches
gen-protos
proc-macros cargo: explicitly indicate paths to publish 2024-04-15 20:37:00 -07:00
src CommitRewriter::rewrite_parents(): Take IntoIterator instead of &[CommitId] 2024-04-21 23:31:17 -04:00
tests rewrite: make CommitRewriter::replace_parents() remove repeats 2024-04-18 21:06:52 -07:00
testutils compile integration tests as a single binary 2024-02-06 18:19:41 -08:00
Cargo.toml cargo: explicitly indicate paths to publish 2024-04-15 20:37:00 -07:00
LICENSE