Skip to content

Commit 15c6d6c

Browse files
committed
Inline the used cfg options
1 parent 790aa9a commit 15c6d6c

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

vdev/src/commands/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl Cli {
3434
command.arg("--features");
3535
if !self.feature.is_empty() {
3636
command.args([self.feature.join(",")]);
37-
} else if platform::windows() {
37+
} else if cfg!(windows) {
3838
command.arg("default-msvc");
3939
} else {
4040
command.arg("default");

vdev/src/commands/test.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use clap::Args;
33
use std::collections::BTreeMap;
44

55
use crate::app;
6-
use crate::platform;
76
use crate::testing::{config::RustToolchainConfig, runner::*};
87

98
/// Execute tests
@@ -43,7 +42,7 @@ impl Cli {
4342
args.extend(extra_args.to_owned());
4443

4544
if !(self.container || extra_args.contains(&"--features".to_string())) {
46-
if platform::windows() {
45+
if cfg!(windows) {
4746
args.extend(["--features".to_string(), "default-msvc".to_string()]);
4847
} else {
4948
args.extend(["--features".to_string(), "default".to_string()]);

vdev/src/platform.rs

+2-16
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,15 @@ pub fn data_dir() -> PathBuf {
2727
}
2828

2929
pub fn default_target() -> String {
30-
if windows() {
30+
if cfg!(windows) {
3131
format!("{}-pc-windows-msvc", ARCH)
32-
} else if macos() {
32+
} else if cfg!(macos) {
3333
format!("{}-apple-darwin", ARCH)
3434
} else {
3535
format!("{}-unknown-linux-gnu", ARCH)
3636
}
3737
}
3838

39-
pub const fn windows() -> bool {
40-
cfg!(windows)
41-
}
42-
43-
#[allow(dead_code)]
44-
pub const fn macos() -> bool {
45-
cfg!(target_os = "macos")
46-
}
47-
48-
#[allow(dead_code)]
49-
pub const fn unix() -> bool {
50-
cfg!(not(any(windows, target_os = "macos")))
51-
}
52-
5339
#[once]
5440
fn _project_dirs() -> Option<ProjectDirs> {
5541
ProjectDirs::from("", "vector", "vdev")

0 commit comments

Comments
 (0)