##// END OF EJS Templates
rust-cpython: import utils::files::* function at module level...
Yuya Nishihara -
r44210:f79377f2 default
parent child Browse files
Show More
@@ -15,10 +15,8 b' use crate::exceptions::{PatternError, Pa'
15 use cpython::{
15 use cpython::{
16 PyBytes, PyDict, PyModule, PyObject, PyResult, PyTuple, Python, ToPyObject,
16 PyBytes, PyDict, PyModule, PyObject, PyResult, PyTuple, Python, ToPyObject,
17 };
17 };
18 use hg::{
18 use hg::utils::files;
19 build_single_regex, read_pattern_file, utils::files::get_path_from_bytes,
19 use hg::{build_single_regex, read_pattern_file, LineNumber, PatternTuple};
20 LineNumber, PatternTuple,
21 };
22 use std::path::PathBuf;
20 use std::path::PathBuf;
23
21
24 /// Rust does not like functions with different return signatures.
22 /// Rust does not like functions with different return signatures.
@@ -38,7 +36,7 b' fn read_pattern_file_wrapper('
38 source_info: bool,
36 source_info: bool,
39 ) -> PyResult<PyTuple> {
37 ) -> PyResult<PyTuple> {
40 let bytes = file_path.extract::<PyBytes>(py)?;
38 let bytes = file_path.extract::<PyBytes>(py)?;
41 let path = get_path_from_bytes(bytes.data(py));
39 let path = files::get_path_from_bytes(bytes.data(py));
42 match read_pattern_file(path, warn) {
40 match read_pattern_file(path, warn) {
43 Ok((patterns, warnings)) => {
41 Ok((patterns, warnings)) => {
44 if source_info {
42 if source_info {
General Comments 0
You need to be logged in to leave comments. Login now