Patchwork D8492: rust-matchers: add TODO about incomplete `Display` for `IncludeMatcher`

login
register
mail settings
Submitter phabricator
Date May 6, 2020, 1:11 p.m.
Message ID <differential-rev-PHID-DREV-w5av6noqc66atxfmksm7-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46257/
State Superseded
Headers show

Comments

phabricator - May 6, 2020, 1:11 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is purely for future reference, I don't think this is a problem right now,
  since the `Display` is *only* used to ease debugging and has no real users.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8492

AFFECTED FILES
  rust/hg-core/src/matchers.rs

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/hg-core/src/matchers.rs b/rust/hg-core/src/matchers.rs
--- a/rust/hg-core/src/matchers.rs
+++ b/rust/hg-core/src/matchers.rs
@@ -666,6 +666,12 @@ 
 
 impl<'a> Display for IncludeMatcher<'a> {
     fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
+        // XXX What about exact matches?
+        // I'm not sure it's worth it to clone the HashSet and keep it
+        // around just in case someone wants to display the matcher, plus
+        // it's going to be unreadable after a few entries, but we need to
+        // inform in this display that exact matches are being used and are
+        // (on purpose) missing from the `includes`.
         write!(
             f,
             "IncludeMatcher(includes='{}')",