Skip to content

Commit 5757510

Browse files
committed
Windows: fix FileType PartialEq implementation
1 parent 3bfb6af commit 5757510

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

library/std/src/sys/fs/windows.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub struct FileAttr {
3939
file_index: Option<u64>,
4040
}
4141

42-
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
42+
#[derive(Copy, Clone, Eq, Hash, Debug)]
4343
pub struct FileType {
4444
attributes: u32,
4545
reparse_tag: u32,
@@ -1140,6 +1140,12 @@ impl FileType {
11401140
}
11411141
}
11421142

1143+
impl PartialEq for FileType {
1144+
fn eq(&self, other: &Self) -> bool {
1145+
self.is_symlink() == other.is_symlink() && self.is_directory() == other.is_directory()
1146+
}
1147+
}
1148+
11431149
impl DirBuilder {
11441150
pub fn new() -> DirBuilder {
11451151
DirBuilder

0 commit comments

Comments
 (0)