We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
if cfg!(..) { }
#[cfg!(..)] { }
1 parent f1c8e56 commit 684391eCopy full SHA for 684391e
crates/cargo-util/src/paths.rs
@@ -679,7 +679,8 @@ fn exclude_from_backups(path: &Path) {
679
///
680
/// This is currently a no-op on non-Windows platforms.
681
fn exclude_from_content_indexing(path: &Path) {
682
- if cfg!(windows) {
+ #[cfg(windows)]
683
+ {
684
use std::iter::once;
685
use std::os::windows::prelude::OsStrExt;
686
use winapi::um::fileapi::{GetFileAttributesW, SetFileAttributesW};
@@ -692,7 +693,9 @@ fn exclude_from_content_indexing(path: &Path) {
692
693
GetFileAttributesW(path.as_ptr()) | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
694
);
695
}
- } else {
696
+ }
697
+ #[cfg(not(windows))]
698
699
let _ = path;
700
701
0 commit comments