mirror of
https://github.com/rust-lang/cargo
synced 2024-11-05 18:50:39 +00:00
Format exclude_from_content_indexing
This commit is contained in:
parent
9d96a88961
commit
f1c8e56909
1 changed files with 5 additions and 2 deletions
|
@ -685,9 +685,12 @@ fn exclude_from_content_indexing(path: &Path) {
|
|||
use winapi::um::fileapi::{GetFileAttributesW, SetFileAttributesW};
|
||||
use winapi::um::winnt::FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
|
||||
|
||||
let lp_path: Vec<u16> = path.as_os_str().encode_wide().chain(once(0)).collect();
|
||||
let path: Vec<u16> = path.as_os_str().encode_wide().chain(once(0)).collect();
|
||||
unsafe {
|
||||
SetFileAttributesW(lp_path.as_ptr(), GetFileAttributesW(lp_path.as_ptr()) | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
|
||||
SetFileAttributesW(
|
||||
path.as_ptr(),
|
||||
GetFileAttributesW(path.as_ptr()) | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
|
||||
);
|
||||
}
|
||||
} else {
|
||||
let _ = path;
|
||||
|
|
Loading…
Reference in a new issue