Skip to content

Commit

Permalink
Have cap-fs-ext re-export OpenOptionsExt and MetadataExt. (#359)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
sunfishcode authored Jul 8, 2024
1 parent c3e03fd commit 3975f7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cap-fs-ext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions cap-primitives/src/fs/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3975f7d

Please sign in to comment.