Make the Metadata struct Clone
This commit adds #[derive(Clone)] to std::fs::Metadata, making that struct cloneable. Although the exact contents of that struct differ between OSes, they all have it contain only value types, meaning that the data can be re-used without repercussions. It also adds #[derive(Clone)] to every type used by that struct across all OSes, including the various Unix `stat` structs and Windows's `WIN32_FILE_ATTRIBUTE_DATA`.
This commit is contained in:
parent
ec4362da56
commit
b40163beb9
14 changed files with 22 additions and 0 deletions
|
@ -60,6 +60,7 @@ pub struct File {
|
|||
/// represents known metadata about a file such as its permissions, size,
|
||||
/// modification times, etc.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[derive(Clone)]
|
||||
pub struct Metadata(fs_imp::FileAttr);
|
||||
|
||||
/// Iterator over the entries in a directory.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue