From b40163beb925b176fdb570e4f4998ab9919e77a4 Mon Sep 17 00:00:00 2001 From: Ben S Date: Tue, 13 Oct 2015 13:06:00 +0100 Subject: 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`. --- src/libstd/os/android/raw.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libstd/os/android') diff --git a/src/libstd/os/android/raw.rs b/src/libstd/os/android/raw.rs index cad80c55140..391ca16f692 100644 --- a/src/libstd/os/android/raw.rs +++ b/src/libstd/os/android/raw.rs @@ -39,6 +39,7 @@ mod arch { pub type time_t = i32; #[repr(C)] + #[derive(Clone)] #[stable(feature = "raw_ext", since = "1.1.0")] pub struct stat { #[stable(feature = "raw_ext", since = "1.1.0")] @@ -108,6 +109,7 @@ mod arch { pub type time_t = i64; #[repr(C)] + #[derive(Clone)] #[stable(feature = "raw_ext", since = "1.1.0")] pub struct stat { #[stable(feature = "raw_ext", since = "1.1.0")] -- cgit 1.4.1-3-g733a5