Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit c34bc0f

Browse files
tspiterisoc
authored andcommitted
Remove cfg-if dependency
This is to allow the crate to compile with rustc 1.13.
1 parent 887e2ae commit c34bc0f

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ maintenance = { status = "actively-developed" }
1010
keywords = ["xdg", "basedir", "app_dirs", "path", "folder"]
1111

1212
[dependencies]
13-
cfg-if = "=0.1.9"
1413
dirs-sys = "0.3.5"

src/lib.rs

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,35 @@
1313
1414
#![deny(missing_docs)]
1515

16-
#[macro_use]
17-
extern crate cfg_if;
18-
1916
use std::path::PathBuf;
2017

21-
cfg_if! {
22-
if #[cfg(target_os = "windows")] {
23-
mod win;
24-
use win as sys;
25-
} else if #[cfg(any(target_os = "macos", target_os = "ios"))] {
26-
mod mac;
27-
use mac as sys;
28-
} else if #[cfg(target_arch = "wasm32")] {
29-
mod wasm;
30-
use wasm as sys;
31-
} else {
32-
mod lin;
33-
use lin as sys;
34-
}
35-
}
18+
#[cfg(target_os = "windows")]
19+
mod win;
20+
#[cfg(target_os = "windows")]
21+
use win as sys;
22+
23+
#[cfg(any(target_os = "macos", target_os = "ios"))]
24+
mod mac;
25+
#[cfg(any(target_os = "macos", target_os = "ios"))]
26+
use mac as sys;
27+
28+
#[cfg(target_arch = "wasm32")]
29+
mod wasm;
30+
#[cfg(target_arch = "wasm32")]
31+
use wasm as sys;
32+
33+
#[cfg(not(any(
34+
target_os = "windows",
35+
target_os = "macos", target_os = "ios",
36+
target_arch = "wasm32"
37+
)))]
38+
mod lin;
39+
#[cfg(not(any(
40+
target_os = "windows",
41+
target_os = "macos", target_os = "ios",
42+
target_arch = "wasm32"
43+
)))]
44+
use lin as sys;
3645

3746
/// Returns the path to the user's home directory.
3847
///

0 commit comments

Comments
 (0)