Skip to content

Commit 684391e

Browse files
Change if cfg!(..) { } to #[cfg!(..)] { }
This fixes builds on non-Windows platforms.
1 parent f1c8e56 commit 684391e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/cargo-util/src/paths.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,8 @@ fn exclude_from_backups(path: &Path) {
679679
///
680680
/// This is currently a no-op on non-Windows platforms.
681681
fn exclude_from_content_indexing(path: &Path) {
682-
if cfg!(windows) {
682+
#[cfg(windows)]
683+
{
683684
use std::iter::once;
684685
use std::os::windows::prelude::OsStrExt;
685686
use winapi::um::fileapi::{GetFileAttributesW, SetFileAttributesW};
@@ -692,7 +693,9 @@ fn exclude_from_content_indexing(path: &Path) {
692693
GetFileAttributesW(path.as_ptr()) | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
693694
);
694695
}
695-
} else {
696+
}
697+
#[cfg(not(windows))]
698+
{
696699
let _ = path;
697700
}
698701
}

0 commit comments

Comments
 (0)