Patchwork D1845: rust: move import of PathBuf

login
register
mail settings
Submitter phabricator
Date Jan. 11, 2018, 3:42 a.m.
Message ID <differential-rev-PHID-DREV-eswp4lssencgwnku4kvc-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26673/
State Superseded
Headers show

Comments

phabricator - Jan. 11, 2018, 3:42 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  By moving it to the single function that uses it, we eliminate a
  #cfg.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1845

AFFECTED FILES
  rust/hgcli/build.rs

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/rust/hgcli/build.rs b/rust/hgcli/build.rs
--- a/rust/hgcli/build.rs
+++ b/rust/hgcli/build.rs
@@ -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();