Skip to content

Commit a4cb0b9

Browse files
committed
Seal Windows FileTypeExt extension trait to allow adding future methods
1 parent e374c91 commit a4cb0b9

File tree

1 file changed

+5
-1
lines changed
  • library/std/src/os/windows

1 file changed

+5
-1
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use crate::fs::{self, Metadata, OpenOptions};
88
use crate::io;
99
use crate::path::Path;
10+
use crate::sealed::Sealed;
1011
use crate::sys;
1112
use crate::sys_common::{AsInner, AsInnerMut};
1213

@@ -503,7 +504,7 @@ impl MetadataExt for Metadata {
503504
///
504505
/// On Windows, a symbolic link knows whether it is a file or directory.
505506
#[stable(feature = "windows_file_type_ext", since = "1.64.0")]
506-
pub trait FileTypeExt {
507+
pub trait FileTypeExt: Sealed {
507508
/// Returns `true` if this file type is a symbolic link that is also a directory.
508509
#[stable(feature = "windows_file_type_ext", since = "1.64.0")]
509510
fn is_symlink_dir(&self) -> bool;
@@ -512,6 +513,9 @@ pub trait FileTypeExt {
512513
fn is_symlink_file(&self) -> bool;
513514
}
514515

516+
#[stable(feature = "windows_file_type_ext", since = "1.64.0")]
517+
impl Sealed for fs::FileType {}
518+
515519
#[stable(feature = "windows_file_type_ext", since = "1.64.0")]
516520
impl FileTypeExt for fs::FileType {
517521
fn is_symlink_dir(&self) -> bool {

0 commit comments

Comments
 (0)