Skip to content

Commit

Permalink
Derive Clone, PartialEq, and Eq for std::io::{FileAccess, FileMode}
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
ipetkov committed Dec 26, 2014
1 parent bd3cf4c commit 3358e64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libstd/io/mod.rs
Expand Up @@ -1682,7 +1682,7 @@ pub fn standard_error(kind: IoErrorKind) -> IoError {
/// A mode specifies how a file should be opened or created. These modes are
/// passed to `File::open_mode` and are used to control where the file is
/// positioned when it is initially opened.
#[deriving(Copy)]
#[deriving(Copy, Clone, PartialEq, Eq)]
pub enum FileMode {
/// Opens a file positioned at the beginning.
Open,
Expand All @@ -1694,7 +1694,7 @@ pub enum FileMode {

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

0 comments on commit 3358e64

Please sign in to comment.