D6592: rust-minor-fixes: simplify overly complicated expression

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Thu Jul 4 14:59:27 UTC 2019


Alphare created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  rust/hg-cpython/src/dirstate.rs

CHANGE DETAILS

diff --git a/rust/hg-cpython/src/dirstate.rs b/rust/hg-cpython/src/dirstate.rs
--- a/rust/hg-cpython/src/dirstate.rs
+++ b/rust/hg-cpython/src/dirstate.rs
@@ -291,8 +291,7 @@
         Ok(self
             .dirs_map(py)
             .borrow()
-            .get(&item.extract::<PyBytes>(py)?.data(py).to_owned())
-            .is_some())
+            .contains_key(item.extract::<PyBytes>(py)?.data(py).as_ref()))
     }
 });
 



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


More information about the Mercurial-devel mailing list