D6232: rust-discovery: cpython bindings for the core logic

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Apr 18 19:22:36 EDT 2019


yuja added a comment.


  > +    def addinfo(&self, sample: PyObject) -> PyResult<PyObject> {
  >  +        let mut missing: Vec<Revision> = Vec::new();
  >  +        let mut common: Vec<Revision> = Vec::new();
  >  +        for info in sample.iter(py)? { // info is a pair (Revision, bool)
  >  +            let mut revknown = info?.iter(py)?;
  >  +            let rev: Revision = revknown.next().unwrap()?.extract(py)?;
  >  +            let known: bool = revknown.next().unwrap()?.extract(py)?;
  
  Just to confirm. Can we be sure that this `unwrap()` never fails? I mean if
  we passed in an empty tuple for example, what would happen?

REPOSITORY
  rHG Mercurial

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

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


More information about the Mercurial-devel mailing list