mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Change if cfg!(..) { }
to #[cfg!(..)] { }
This fixes builds on non-Windows platforms.
This commit is contained in:
parent
f1c8e56909
commit
684391e444
@ -679,7 +679,8 @@ fn exclude_from_backups(path: &Path) {
|
||||
///
|
||||
/// This is currently a no-op on non-Windows platforms.
|
||||
fn exclude_from_content_indexing(path: &Path) {
|
||||
if cfg!(windows) {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use std::iter::once;
|
||||
use std::os::windows::prelude::OsStrExt;
|
||||
use winapi::um::fileapi::{GetFileAttributesW, SetFileAttributesW};
|
||||
@ -692,7 +693,9 @@ fn exclude_from_content_indexing(path: &Path) {
|
||||
GetFileAttributesW(path.as_ptr()) | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
|
||||
);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
let _ = path;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user