Skip to content

Commit

Permalink
Remove cfg-if dependency
Browse files Browse the repository at this point in the history
This is to allow the crate to compile with rustc 1.13.
  • Loading branch information
tspiteri authored and soc committed Jul 4, 2020
1 parent 887e2ae commit c34bc0f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ maintenance = { status = "actively-developed" }
keywords = ["xdg", "basedir", "app_dirs", "path", "folder"]

[dependencies]
cfg-if = "=0.1.9"
dirs-sys = "0.3.5"
45 changes: 27 additions & 18 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,35 @@
#![deny(missing_docs)]

#[macro_use]
extern crate cfg_if;

use std::path::PathBuf;

cfg_if! {
if #[cfg(target_os = "windows")] {
mod win;
use win as sys;
} else if #[cfg(any(target_os = "macos", target_os = "ios"))] {
mod mac;
use mac as sys;
} else if #[cfg(target_arch = "wasm32")] {
mod wasm;
use wasm as sys;
} else {
mod lin;
use lin as sys;
}
}
#[cfg(target_os = "windows")]
mod win;
#[cfg(target_os = "windows")]
use win as sys;

#[cfg(any(target_os = "macos", target_os = "ios"))]
mod mac;
#[cfg(any(target_os = "macos", target_os = "ios"))]
use mac as sys;

#[cfg(target_arch = "wasm32")]
mod wasm;
#[cfg(target_arch = "wasm32")]
use wasm as sys;

#[cfg(not(any(
target_os = "windows",
target_os = "macos", target_os = "ios",
target_arch = "wasm32"
)))]
mod lin;
#[cfg(not(any(
target_os = "windows",
target_os = "macos", target_os = "ios",
target_arch = "wasm32"
)))]
use lin as sys;

/// Returns the path to the user's home directory.
///
Expand Down

0 comments on commit c34bc0f

Please sign in to comment.