D7865: rust-fmt: run cargo fmt
Alphare (Raphaël Gomès)
phabricator at mercurial-scm.org
Tue Jan 14 17:33:38 UTC 2020
Alphare created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D7865
AFFECTED FILES
rust/hg-cpython/src/revlog.rs
CHANGE DETAILS
diff --git a/rust/hg-cpython/src/revlog.rs b/rust/hg-cpython/src/revlog.rs
--- a/rust/hg-cpython/src/revlog.rs
+++ b/rust/hg-cpython/src/revlog.rs
@@ -7,14 +7,17 @@
use crate::cindex;
use cpython::{
- ObjectProtocol, PyClone, PyDict, PyModule, PyObject, PyResult, PyTuple, Python, PythonObject,
- ToPyObject,
+ ObjectProtocol, PyClone, PyDict, PyModule, PyObject, PyResult, PyTuple,
+ Python, PythonObject, ToPyObject,
};
use hg::Revision;
use std::cell::RefCell;
/// Return a Struct implementing the Graph trait
-pub(crate) fn pyindex_to_graph(py: Python, index: PyObject) -> PyResult<cindex::Index> {
+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),
To: Alphare, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel
More information about the Mercurial-devel
mailing list