From 3975f7d7fd04877db1c263330100d198f3e46365 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Jul 2024 07:43:02 -0700 Subject: [PATCH] Have `cap-fs-ext` re-export `OpenOptionsExt` and `MetadataExt`. (#359) * Have `cap-fs-ext` re-export `OpenOptionsExt` and `MetadataExt`. Since cap-fs-ext is already re-exporting `OpenOptions` and `Metadata`, now that `OpenOptionsExt` and `MetadataExt` are custom traits instead of std traits, re-export them so users can use them with `OpenOptions` and `Metadata`. * Rename `MetadataExt` to avoid name conflicts. --- cap-fs-ext/src/lib.rs | 4 +++- cap-primitives/src/fs/metadata.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cap-fs-ext/src/lib.rs b/cap-fs-ext/src/lib.rs index 65c0a4cd..cacef0e3 100644 --- a/cap-fs-ext/src/lib.rs +++ b/cap-fs-ext/src/lib.rs @@ -36,7 +36,9 @@ pub use open_options_sync_ext::OpenOptionsSyncExt; pub use reopen::Reopen; /// Re-export these to allow them to be used with `Reuse`. -pub use cap_primitives::fs::{FollowSymlinks, Metadata, OpenOptions}; +pub use cap_primitives::fs::{ + FollowSymlinks, Metadata, MetadataExt as OsMetadataExt, OpenOptions, OpenOptionsExt, +}; #[doc(hidden)] pub use cap_primitives::ambient_authority_known_at_compile_time; diff --git a/cap-primitives/src/fs/metadata.rs b/cap-primitives/src/fs/metadata.rs index ed214e2a..738fe7b9 100644 --- a/cap-primitives/src/fs/metadata.rs +++ b/cap-primitives/src/fs/metadata.rs @@ -261,6 +261,8 @@ pub trait MetadataExt { } /// Windows-specific extensions to [`Metadata`]. +/// +/// This corresponds to [`std::os::windows::fs::MetadataExt`]. #[cfg(windows)] pub trait MetadataExt { /// Returns the value of the `dwFileAttributes` field of this metadata.