Mercurial > hg
diff rust/hg-cpython/src/dirstate/dirstate_map.rs @ 44362:c089a0947f3e
rust-dirstatemap: directly return `non_normal` and `other_entries`
This cleans up the interface which I previously thought needed to be uglier
than in reality. No performance difference, simple refactoring.
Differential Revision: https://phab.mercurial-scm.org/D8121
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Fri, 14 Feb 2020 15:03:26 +0100 |
parents | a69c08cdb2a8 |
children | 8ac5726d695d |
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs Thu Dec 26 14:12:45 2019 -0800 +++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs Fri Feb 14 15:03:26 2020 +0100 @@ -175,8 +175,7 @@ locals.set_item( py, "other_parent", - other_parent.as_ref() - .unwrap() + other_parent .iter() .map(|v| PyBytes::new(py, v.as_ref())) .collect::<Vec<PyBytes>>() @@ -196,8 +195,6 @@ .inner(py) .borrow_mut() .get_non_normal_other_parent_entries().0 - .as_ref() - .unwrap() .contains(HgPath::new(key.data(py)))) } @@ -211,8 +208,7 @@ .inner(py) .borrow_mut() .get_non_normal_other_parent_entries().0 - .as_ref() - .unwrap().iter().map(|o| o)) + .iter().map(|o| o)) ) ) }