Patchwork D7654: rust-index: add a `inner` method to the Index struct

login
register
mail settings
Submitter phabricator
Date Dec. 13, 2019, 8:12 p.m.
Message ID <differential-rev-PHID-DREV-fv5wnb7jiehkzpbzxchw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43809/
State Superseded
Headers show

Comments

phabricator - Dec. 13, 2019, 8:12 p.m.
marmoute created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We are about to introduce a Rust wrapper to the C index. It will be exposed as a
  Python object. As a start all call will be forwarded to an internal index object
  (as used now).
  
  For this forwarding to works, we need to access that index object (from the C
  extensions). We adds a method doing to on the existing `Index` rust struct.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7654

AFFECTED FILES
  rust/hg-cpython/src/cindex.rs

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel

Patch

diff --git a/rust/hg-cpython/src/cindex.rs b/rust/hg-cpython/src/cindex.rs
--- a/rust/hg-cpython/src/cindex.rs
+++ b/rust/hg-cpython/src/cindex.rs
@@ -68,6 +68,11 @@ 
             parents: get_parents_capi::retrieve(py)?,
         })
     }
+
+    /// return a reference to the CPython Index object in this Struct
+    pub fn inner(&self) -> &PyObject {
+        &self.index
+    }
 }
 
 impl Clone for Index {