rust: move import of PathBuf
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 10 Jan 2018 19:23:36 -0800
changeset 35603 11c86ab69e67
parent 35602 998b585f156c
child 35604 74bec9e74831
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
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();