Mercurial > hg
diff COPYING @ 45607:75f785888a7b
rust-matchers: make `Matcher` trait object-safe
Before this patch, it is not possible to create a `Matcher` trait-object (like
`Box<dyn Matcher>`), because of the use of a generic parameters in some methods,
namely `impl AsRef<HgPath>`.
While this makes the interface less flexible for callers in theory, it does not
change anything in the current codebase.
Until something like [1] is implemented, this is a "tradeoff" that we need to
make anyway.
[1] https://internals.rust-lang.org/t/pre-rfc-expand-object-safety/12693
Differential Revision: https://phab.mercurial-scm.org/D9071
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Wed, 23 Sep 2020 10:02:16 +0200 |
parents | 8c8b55733cbd |
children |