D7526: rust-hg-path: add method to get part of a path relative to a prefix

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Dec 10 13:04:06 EST 2019


martinvonz added inline comments.

INLINE COMMENTS

> hg_path.rs:438
> +        let base = HgPath::new(b"");
> +        assert_eq!(Some(path), path.relative_to(base));
> +

The argument order here feels backwards. I know some frameworks (like Java's JUnit) put the expected value first, but the definition of `assert_eq!` doesn't seem to have any opinion and https://doc.rust-lang.org/stable/rust-by-example/testing/unit_testing.html puts the actual value first. What do you think about changing the order? That would make it more readable to me.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7526/new/

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

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


More information about the Mercurial-devel mailing list