author | Pierre-Yves David <pierre-yves.david@octobus.net> |
Fri, 13 Dec 2019 19:59:59 +0100 | |
changeset 43945 | f98f0e3ddaa1 |
child 43961 | b69d5f3a41d0 |
permissions | -rw-r--r-- |
43945
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
1 |
// revlog.rs |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
2 |
// |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
3 |
// Copyright 2019 Georges Racinet <georges.racinet@octobus.net> |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
4 |
// |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
5 |
// This software may be used and distributed according to the terms of the |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
6 |
// GNU General Public License version 2 or any later version. |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
7 |
|
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
8 |
use crate::cindex; |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
9 |
use cpython::{PyObject, PyResult, Python}; |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
10 |
|
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
11 |
/// Return a Struct implementing the Graph trait |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
12 |
pub(crate) fn pyindex_to_graph( |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
13 |
py: Python, |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
14 |
index: PyObject, |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
15 |
) -> PyResult<cindex::Index> { |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
16 |
cindex::Index::new(py, index) |
f98f0e3ddaa1
rust-index: add a function to convert PyObject index for hg-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
17 |
} |