# HG changeset patch # User Gregory Szorc # Date 1515641016 28800 # Node ID 11c86ab69e670a0853c337c11c496e10da254dd1 # Parent 998b585f156ce01d5a19fe512388c32c73de4a11 rust: move import of PathBuf By moving it to the single function that uses it, we eliminate a #cfg. Differential Revision: https://phab.mercurial-scm.org/D1845 diff -r 998b585f156c -r 11c86ab69e67 rust/hgcli/build.rs --- a/rust/hgcli/build.rs Wed Jan 10 21:09:57 2018 -0800 +++ b/rust/hgcli/build.rs Wed Jan 10 19:23:36 2018 -0800 @@ -8,9 +8,6 @@ use std::collections::HashMap; use std::env; use std::path::Path; -#[cfg(target_os = "windows")] -use std::path::PathBuf; - use std::process::Command; struct PythonConfig { @@ -77,6 +74,8 @@ #[cfg(target_os = "windows")] fn have_shared(config: &PythonConfig) -> bool { + use std::path::PathBuf; + // python27.dll should exist next to python2.7.exe. let mut dll = PathBuf::from(&config.python); dll.pop();