diff rust/hg-cpython/src/revlog.rs @ 51245:0b81440e2a73

rust-index: using `hg::index::Index` in discovery At this point the C index is not used any more: we had to remove `pyindex_to_graph()` to avoid the dead code warning.
author Georges Racinet <georges.racinet@octobus.net>
date Sun, 29 Oct 2023 12:07:05 +0100
parents 7eea2e4109ae
children 41e19e8a6133
line wrap: on
line diff
--- a/rust/hg-cpython/src/revlog.rs	Sun Oct 29 12:01:57 2023 +0100
+++ b/rust/hg-cpython/src/revlog.rs	Sun Oct 29 12:07:05 2023 +0100
@@ -31,17 +31,6 @@
 use std::{cell::RefCell, collections::HashMap};
 use vcsgraph::graph::Graph as VCSGraph;
 
-/// Return a Struct implementing the Graph trait
-pub(crate) fn pyindex_to_graph(
-    py: Python,
-    index: PyObject,
-) -> PyResult<cindex::Index> {
-    match index.extract::<MixedIndex>(py) {
-        Ok(midx) => Ok(midx.clone_cindex(py)),
-        Err(_) => cindex::Index::new(py, index),
-    }
-}
-
 pub struct PySharedIndex {
     /// The underlying hg-core index
     pub(crate) inner: &'static hg::index::Index,