about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-12-14 22:46:05 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-12-19 10:43:24 -0500
commitfd4a5d9ef12a87cad61f2fa5dd0a011df263a2d0 (patch)
tree4975bc3dc192d495bafa0f1bf5dcdfb6ff3ba59a
parenta18d090c3cf6223b90c5a39e66ddef3e1932c7c7 (diff)
downloadrust-fd4a5d9ef12a87cad61f2fa5dd0a011df263a2d0.tar.gz
rust-fd4a5d9ef12a87cad61f2fa5dd0a011df263a2d0.zip
librbml: use `#[deriving(Copy)]`
-rw-r--r--src/librbml/lib.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs
index bb7af92eb54..19e79b1eb7b 100644
--- a/src/librbml/lib.rs
+++ b/src/librbml/lib.rs
@@ -41,15 +41,13 @@ use std::str;
 pub mod io;
 
 /// Common data structures
-#[deriving(Clone)]
+#[deriving(Clone, Copy)]
 pub struct Doc<'a> {
     pub data: &'a [u8],
     pub start: uint,
     pub end: uint,
 }
 
-impl<'doc> Copy for Doc<'doc> {}
-
 impl<'doc> Doc<'doc> {
     pub fn new(data: &'doc [u8]) -> Doc<'doc> {
         Doc { data: data, start: 0u, end: data.len() }
@@ -73,7 +71,7 @@ pub struct TaggedDoc<'a> {
     pub doc: Doc<'a>,
 }
 
-#[deriving(Show)]
+#[deriving(Copy, Show)]
 pub enum EbmlEncoderTag {
     EsUint,     // 0
     EsU64,      // 1
@@ -107,8 +105,6 @@ pub enum EbmlEncoderTag {
     EsLabel, // Used only when debugging
 }
 
-impl Copy for EbmlEncoderTag {}
-
 #[deriving(Show)]
 pub enum Error {
     IntTooBig(uint),
@@ -151,13 +147,12 @@ pub mod reader {
         )
     }
 
+    #[deriving(Copy)]
     pub struct Res {
         pub val: uint,
         pub next: uint
     }
 
-    impl Copy for Res {}
-
     #[inline(never)]
     fn vuint_at_slow(data: &[u8], start: uint) -> DecodeResult<Res> {
         let a = data[start];