rust/hg-cpython/src/dagops.rs
changeset 43269 33fe96a5c522
parent 42609 326fdce22fb2
child 43945 f98f0e3ddaa1
--- a/rust/hg-cpython/src/dagops.rs	Tue Oct 15 22:02:34 2019 -0400
+++ b/rust/hg-cpython/src/dagops.rs	Mon Sep 30 16:31:53 2019 -0400
@@ -10,9 +10,7 @@
 //!
 //! From Python, this will be seen as `mercurial.rustext.dagop`
 use crate::{
-    cindex::Index,
-    conversion::{py_set, rev_pyiter_collect},
-    exceptions::GraphError,
+    cindex::Index, conversion::rev_pyiter_collect, exceptions::GraphError,
 };
 use cpython::{PyDict, PyModule, PyObject, PyResult, Python};
 use hg::dagops;
@@ -26,11 +24,11 @@
     py: Python,
     index: PyObject,
     revs: PyObject,
-) -> PyResult<PyObject> {
+) -> PyResult<HashSet<Revision>> {
     let mut as_set: HashSet<Revision> = rev_pyiter_collect(py, &revs)?;
     dagops::retain_heads(&Index::new(py, index)?, &mut as_set)
         .map_err(|e| GraphError::pynew(py, e))?;
-    py_set(py, &as_set)
+    Ok(as_set)
 }
 
 /// Create the module, with `__package__` given from parent