From b3f1e1844db72feef641b1c710d54fa2939d41a0 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Thu, 26 Oct 2017 21:44:40 +0200 Subject: [PATCH] Move 'win' crate back into local module This is necessary to publish on crates.io --- Cargo.lock | 11 ++--------- Cargo.toml | 3 ++- src/main.rs | 6 ++++-- win/src/lib.rs => src/windows.rs | 0 win/Cargo.lock | 31 ------------------------------- win/Cargo.toml | 7 ------- 6 files changed, 8 insertions(+), 50 deletions(-) rename win/src/lib.rs => src/windows.rs (100%) delete mode 100644 win/Cargo.lock delete mode 100644 win/Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index 6f9e3b4..420eb9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,6 +7,7 @@ dependencies = [ "clap 2.26.2 (registry+https://github.com/rust-lang/crates.io-index)", "diff 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "ignore 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -14,7 +15,7 @@ dependencies = [ "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "windows 0.0.0", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -330,14 +331,6 @@ name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "windows" -version = "0.0.0" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [metadata] "checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" diff --git a/Cargo.toml b/Cargo.toml index 3729bfc..95781c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,8 @@ shell-escape = "0.1.3" libc = "0.2" [target.'cfg(windows)'.dependencies] -windows = { path = "win" } +kernel32-sys = "0.2" +winapi = "0.2" [dev-dependencies] diff = "0.1" diff --git a/src/main.rs b/src/main.rs index e16e26d..98e6096 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,8 +19,6 @@ extern crate num_cpus; extern crate regex; extern crate regex_syntax; extern crate shell_escape; -#[cfg(windows)] -extern crate windows; pub mod fshelper; pub mod lscolors; @@ -30,6 +28,9 @@ mod internal; mod output; mod walk; +#[cfg(windows)] +mod windows; + use std::env; use std::error::Error; use std::path::{Path, PathBuf}; @@ -95,6 +96,7 @@ fn main() { Some("never") => false, _ => atty::is(Stream::Stdout), }; + #[cfg(windows)] let colored_output = colored_output && windows::enable_colored_output(); diff --git a/win/src/lib.rs b/src/windows.rs similarity index 100% rename from win/src/lib.rs rename to src/windows.rs diff --git a/win/Cargo.lock b/win/Cargo.lock deleted file mode 100644 index 62ef489..0000000 --- a/win/Cargo.lock +++ /dev/null @@ -1,31 +0,0 @@ -[root] -name = "windows" -version = "0.0.0" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/win/Cargo.toml b/win/Cargo.toml deleted file mode 100644 index c1d95a2..0000000 --- a/win/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "windows" -version = "0.0.0" - -[dependencies] -kernel32-sys = "0.2" -winapi = "0.2"