# HG changeset patch # User Yuya Nishihara # Date 2019-11-19 14:16:16 # Node ID f79377f24487272bdf2e32f838bc9fb983319320 # Parent 44b6056389182e7f2f425891a1b4a7ecf5877425 rust-cpython: import utils::files::* function at module level IIRC, it's common in Rust to call functions with the module prefix. diff --git a/rust/hg-cpython/src/filepatterns.rs b/rust/hg-cpython/src/filepatterns.rs --- a/rust/hg-cpython/src/filepatterns.rs +++ b/rust/hg-cpython/src/filepatterns.rs @@ -15,10 +15,8 @@ use crate::exceptions::{PatternError, Pa 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 @@ fn read_pattern_file_wrapper( source_info: bool, ) -> PyResult { let bytes = file_path.extract::(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 {