D6389: rust-dirstate: create dirstate submodule

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Fri May 24 04:59:19 EDT 2019


Alphare added inline comments.

INLINE COMMENTS

> kevincox wrote in mod.rs:6
> If 1 and 2 are the best names why not just make it `pub struct DirstateParetens([&[u8]; 2])`?

I feel that accessing `parents.p1` is more semantic and less noisy than `parents.0[0]`. Also doing

  DirstateParents([
      b"12345678910111213141",
      b"00000000000000000000",
  ]);

is not miles clearer than

  DirstateParents {
      p1: b"12345678910111213141",
      p2: b"00000000000000000000",
  };

> kevincox wrote in mod.rs:7
> It seems odd that this struct is public seeing as it is just a bag of bytes. Would it make sense to keep this internal to the parser/serializer?

This is public so that `hg-cpython` can use it. I think it helps with readability too, a "bag of bytes" is sometimes not really helpful when stumbling on code.

REPOSITORY
  rHG Mercurial

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

To: Alphare, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list