comparison rust/hg-cpython/src/revlog.rs @ 44070:451d22174b5f

revlog: run rustfmt nightly I'm a little nervous about folding this back (might be nightly rustfmt mismatches?) so I want someone to review this. Differential Revision: https://phab.mercurial-scm.org/D7813
author Augie Fackler <augie@google.com>
date Wed, 08 Jan 2020 14:37:54 -0500
parents 443dc1655923
children 887d0f921b34
comparison
equal deleted inserted replaced
44069:5e0505d36aee 44070:451d22174b5f
5 // This software may be used and distributed according to the terms of the 5 // This software may be used and distributed according to the terms of the
6 // GNU General Public License version 2 or any later version. 6 // GNU General Public License version 2 or any later version.
7 7
8 use crate::cindex; 8 use crate::cindex;
9 use cpython::{ 9 use cpython::{
10 ObjectProtocol, PyClone, PyDict, PyModule, PyObject, PyResult, PyTuple, Python, PythonObject, 10 ObjectProtocol, PyClone, PyDict, PyModule, PyObject, PyResult, PyTuple,
11 ToPyObject, 11 Python, PythonObject, ToPyObject,
12 }; 12 };
13 use hg::Revision; 13 use hg::Revision;
14 use std::cell::RefCell; 14 use std::cell::RefCell;
15 15
16 /// Return a Struct implementing the Graph trait 16 /// Return a Struct implementing the Graph trait
17 pub(crate) fn pyindex_to_graph(py: Python, index: PyObject) -> PyResult<cindex::Index> { 17 pub(crate) fn pyindex_to_graph(
18 py: Python,
19 index: PyObject,
20 ) -> PyResult<cindex::Index> {
18 match index.extract::<MixedIndex>(py) { 21 match index.extract::<MixedIndex>(py) {
19 Ok(midx) => Ok(midx.clone_cindex(py)), 22 Ok(midx) => Ok(midx.clone_cindex(py)),
20 Err(_) => cindex::Index::new(py, index), 23 Err(_) => cindex::Index::new(py, index),
21 } 24 }
22 } 25 }