Mercurial > hg-stable
changeset 43466:4f1cddd1939e stable
rust-cpython: import utils::files::* function at module level
IIRC, it's common in Rust to call functions with the module prefix.
Differential Revision: https://phab.mercurial-scm.org/D7613
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 19 Nov 2019 23:16:16 +0900 |
parents | a264e8a91798 |
children | b06cf2809ec3 |
files | rust/hg-cpython/src/filepatterns.rs |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/rust/hg-cpython/src/filepatterns.rs Mon Nov 18 17:37:59 2019 +0100 +++ b/rust/hg-cpython/src/filepatterns.rs Tue Nov 19 23:16:16 2019 +0900 @@ -15,10 +15,8 @@ use cpython::{ PyBytes, PyDict, PyModule, PyObject, PyResult, PyTuple, Python, ToPyObject, }; -use hg::{ - build_single_regex, read_pattern_file, utils::files::get_path_from_bytes, - LineNumber, PatternTuple, -}; +use hg::utils::files; +use hg::{build_single_regex, read_pattern_file, LineNumber, PatternTuple}; use std::path::PathBuf; /// Rust does not like functions with different return signatures. @@ -38,7 +36,7 @@ source_info: bool, ) -> PyResult<PyTuple> { let bytes = file_path.extract::<PyBytes>(py)?; - let path = get_path_from_bytes(bytes.data(py)); + let path = files::get_path_from_bytes(bytes.data(py)); match read_pattern_file(path, warn) { Ok((patterns, warnings)) => { if source_info {