mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-20 11:25:34 +00:00
f672c92509
This could be implemented as a newtype `Wrapper<'a>(&'a [u8])`, but a lifetime of the wrap function couldn't be specified correctly: fn diff(left: &[u8], right: &[u8], wrap_fn: F, ..) where F: for<'a> Fn(&'a [u8]) -> W<'a>, // F::Output<'a> can't be specified W: Copy + Eq + Hash If the wrapper were of `&Wrapper([u8])` type, `Fn(&[u8]) -> &W` works. However, it means we can no longer set comparison parameter (such as Regex) dynamically. Another idea is to add some filter function of `Fn(&[u8]) -> Cow<'_, [u8]>` type, but I don't think we would want to pay the allocation cost in hashing/comparison code. `Fn(&[u8]) -> impl Iterator<Item = &[u8]>` might work, but it would be equally complex. |
||
---|---|---|
.. | ||
benches | ||
gen-protos | ||
proc-macros | ||
src | ||
tests | ||
testutils | ||
Cargo.toml | ||
LICENSE |