Skip to content
Snippets Groups Projects
Commit 75f78588 authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

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
parent 2a169781
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment