Bläddra i källkod

Make copyable values copyable

Ben S 11 år sedan
förälder
incheckning
224849b0e9
3 ändrade filer med 8 tillägg och 0 borttagningar
  1. 4 0
      src/column.rs
  2. 2 0
      src/filetype.rs
  3. 2 0
      src/options.rs

+ 4 - 0
src/column.rs

@@ -9,6 +9,8 @@ pub enum Column {
     Inode,
 }
 
+impl Copy for Column { }
+
 // Each column can pick its own alignment. Usually, numbers are
 // right-aligned, and text is left-aligned.
 
@@ -16,6 +18,8 @@ pub enum Alignment {
     Left, Right,
 }
 
+impl Copy for Alignment { }
+
 impl Column {
     pub fn alignment(&self) -> Alignment {
         match *self {

+ 2 - 0
src/filetype.rs

@@ -13,6 +13,8 @@ pub enum FileType {
     Image, Video, Music, Lossless, Compressed, Document, Temp, Crypto,
 }
 
+impl Copy for FileType { }
+
 static IMAGE_TYPES: &'static [&'static str] = &[
     "png", "jpeg", "jpg", "gif", "bmp", "tiff", "tif",
     "ppm", "pgm", "pbm", "pnm", "webp", "raw", "arw",

+ 2 - 0
src/options.rs

@@ -12,6 +12,8 @@ pub enum SortField {
     Unsorted, Name, Extension, Size, FileInode
 }
 
+impl Copy for SortField { }
+
 impl SortField {
     fn from_word(word: String) -> SortField {
         match word.as_slice() {