changeset 42558:11c025c83393

rust: simplify overly complicated expression Differential Revision: https://phab.mercurial-scm.org/D6592
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 01 Jul 2019 10:53:36 +0200
parents d26e4a434fe5
children a80464e85ddd
files rust/hg-cpython/src/dirstate.rs
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate.rs	Mon Jul 01 10:50:18 2019 +0200
+++ b/rust/hg-cpython/src/dirstate.rs	Mon Jul 01 10:53:36 2019 +0200
@@ -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()))
     }
 });