diff options
author | Andrew Gallant <jamslam@gmail.com> | 2018-08-21 20:22:08 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2018-08-21 23:05:52 -0400 |
commit | 1529ce33414f33eb432f9efadf3e38609ae89429 (patch) | |
tree | f9883fcbc5bc4040d68a8ce4dac2d8cda1fc8302 /src | |
parent | 95a4f15916699a1188f7b27c7eb71f850f404098 (diff) |
ripgrep: remove workaround for std bug
This commit undoes a work-around for a bug in Rust's standard library
that prevented correct file type detection on Windows in OneDrive
directories. We remove the work-around because we are moving to a
latest-stable Rust version policy, which has included this fix for a while
now.
ref #705, https://github.com/rust-lang/rust/issues/46484
Diffstat (limited to 'src')
-rw-r--r-- | src/subject.rs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/subject.rs b/src/subject.rs index 61b34554..741b4fdd 100644 --- a/src/subject.rs +++ b/src/subject.rs @@ -172,36 +172,11 @@ impl Subject { } /// Returns true if and only if this subject points to a directory. - /// - /// This works around a bug in Rust's standard library: - /// https://github.com/rust-lang/rust/issues/46484 - #[cfg(windows)] - fn is_dir(&self) -> bool { - use std::os::windows::fs::MetadataExt; - use winapi::um::winnt::FILE_ATTRIBUTE_DIRECTORY; - - self.dent.metadata().map(|md| { - md.file_attributes() & FILE_ATTRIBUTE_DIRECTORY != 0 - }).unwrap_or(false) - } - - /// Returns true if and only if this subject points to a directory. - #[cfg(not(windows))] fn is_dir(&self) -> bool { self.dent.file_type().map_or(false, |ft| ft.is_dir()) } /// Returns true if and only if this subject points to a file. - /// - /// This works around a bug in Rust's standard library: - /// https://github.com/rust-lang/rust/issues/46484 - #[cfg(windows)] - fn is_file(&self) -> bool { - !self.is_dir() - } - - /// Returns true if and only if this subject points to a file. - #[cfg(not(windows))] fn is_file(&self) -> bool { self.dent.file_type().map_or(false, |ft| ft.is_file()) } |