Skip to content

Commit 1c61e74

Browse files
committed
rollup merge of #20250: ipetkov/deriving
* Both enums already derived `Copy`, but storing them in any struct/container would prevent implementing `Clone` for said struct/container even though they should be clonable. * Also add PartialEq and Eq for good measure.
2 parents 4717f07 + 3358e64 commit 1c61e74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/io/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,7 @@ pub fn standard_error(kind: IoErrorKind) -> IoError {
17241724
/// A mode specifies how a file should be opened or created. These modes are
17251725
/// passed to `File::open_mode` and are used to control where the file is
17261726
/// positioned when it is initially opened.
1727-
#[deriving(Copy)]
1727+
#[deriving(Copy, Clone, PartialEq, Eq)]
17281728
pub enum FileMode {
17291729
/// Opens a file positioned at the beginning.
17301730
Open,
@@ -1736,7 +1736,7 @@ pub enum FileMode {
17361736

17371737
/// Access permissions with which the file should be opened. `File`s
17381738
/// opened with `Read` will return an error if written to.
1739-
#[deriving(Copy)]
1739+
#[deriving(Copy, Clone, PartialEq, Eq)]
17401740
pub enum FileAccess {
17411741
/// Read-only access, requests to write will result in an error
17421742
Read,

0 commit comments

Comments
 (0)