Repository: AlexPikalov/cdrs (language: rust)

Issue:
CDRS should implement eq
In looking into the possibility of creating a cdrs backend for diesel, I realized that it would be much easier to embed cdrs in other things if it implements eq.


Discussion / hints:

Fix patch:
diff --git a/src/client.rs b/src/client.rs
index 8092077..7459dca 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -20,6 +20,7 @@ use events::{Listener, EventStream, new_listener};
 /// CDRS driver structure that provides a basic functionality to work with DB including
 /// establishing new connection, getting supported options, preparing and executing CQL
 /// queries, using compression and other.
+#[derive(Eq,PartialEq,Ord,PartialOrd)]
 pub struct CDRS<T: Authenticator, X: CDRSTransport> {
     compressor: Compression,
     authenticator: T,
diff --git a/src/compression.rs b/src/compression.rs
index 52fb27d..860caba 100644
--- a/src/compression.rs
+++ b/src/compression.rs
@@ -56,7 +56,7 @@ pub trait Compressor {
 }
 
 /// Enum which represents a type of compression. Only non-startup frame's body can be compressen.
-#[derive(Debug, PartialEq, Clone, Copy)]
+#[derive(Debug, PartialEq, Clone, Copy, Eq, Ord, PartialOrd)]
 pub enum Compression {
     /// [lz4](https://code.google.com/p/lz4/) compression
     Lz4,


Test patch: