changeset 41185:5ac61ca58c3f

rust-cpython: consistency in use of hg-core constructs While not everybody likes the `CoreLazy` and `CoreIterator` aliases, it's better not to mix them with direct references. Note: it's quite possible in the future that these would stop being exposed at the top of the `hg` crate Differential Revision: https://phab.mercurial-scm.org/D5547
author Georges Racinet <georges.racinet@octobus.net>
date Tue, 08 Jan 2019 13:54:01 +0100
parents dcf818267bc1
children 1b4b94bac8a0
files rust/hg-cpython/src/ancestors.rs
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-cpython/src/ancestors.rs	Sat Dec 22 11:38:03 2018 +0100
+++ b/rust/hg-cpython/src/ancestors.rs	Tue Jan 08 13:54:01 2019 +0100
@@ -27,7 +27,6 @@
     ObjectProtocol, PyClone, PyDict, PyModule, PyObject, PyResult, Python,
 };
 use exceptions::GraphError;
-use hg;
 use hg::Revision;
 use hg::{AncestorsIterator as CoreIterator, LazyAncestors as CoreLazy};
 use std::cell::RefCell;
@@ -66,9 +65,9 @@
     def __new__(_cls, index: PyObject, initrevs: PyObject, stoprev: Revision,
                 inclusive: bool) -> PyResult<AncestorsIterator> {
         let initvec = reviter_to_revvec(py, initrevs)?;
-        let ait = match hg::AncestorsIterator::new(Index::new(py, index)?,
-                                                   initvec, stoprev,
-                                                   inclusive) {
+        let ait = match CoreIterator::new(Index::new(py, index)?,
+                                          initvec, stoprev,
+                                          inclusive) {
             Ok(ait) => ait,
             Err(e) => {
                 return Err(GraphError::pynew(py, e));