Repository: AlexPikalov/cdrs (language: rust)

Issue:
new Uuid support
starting from uuid `0.8.1` cdrs gives error:

the trait `std::convert::From<uuid::Uuid>` is not implemented for `cdrs::types::value::Bytes`


Discussion / hints:
@cnd 

Thank you for creating this issue. If you are not working on a solution I'm going to pick this up
@AlexPikalov nothing for, I'm not working on solution :)

Fix patch:
diff --git a/src/error.rs b/src/error.rs
index 4a766f6..1741fe6 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -7,7 +7,7 @@ use std::string::FromUtf8Error;
 
 use crate::compression::CompressionError;
 use crate::frame::frame_error::CDRSError;
-use uuid::BytesError;
+use uuid::Error as UUIDError;
 
 pub type Result<T> = result::Result<T, Error>;
 
@@ -21,7 +21,7 @@ pub enum Error {
     /// Internal IO error.
     Io(io::Error),
     /// Internal error that may be raised during `uuid::Uuid::from_bytes`
-    UUIDParse(BytesError),
+    UUIDParse(UUIDError),
     /// General error
     General(String),
     /// Internal error that may be raised during `String::from_utf8`
@@ -87,8 +87,8 @@ impl From<FromUtf8Error> for Error {
     }
 }
 
-impl From<BytesError> for Error {
-    fn from(err: BytesError) -> Error {
+impl From<UUIDError> for Error {
+    fn from(err: UUIDError) -> Error {
         Error::UUIDParse(err)
     }
 }
diff --git a/src/types/data_serialization_types.rs b/src/types/data_serialization_types.rs
index b830b7d..f6fda4e 100644
--- a/src/types/data_serialization_types.rs
+++ b/src/types/data_serialization_types.rs
@@ -175,8 +175,8 @@ pub fn decode_time(bytes: &[u8]) -> Result<i64, io::Error> {
     try_i_from_bytes(bytes)
 }
 
-// Decodes Cassandra `timeuuid` data (bytes) into Rust's `Result<uuid::Uuid, uuid::BytesError>`
-pub fn decode_timeuuid(bytes: &[u8]) -> Result<uuid::Uuid, uuid::BytesError> {
+// Decodes Cassandra `timeuuid` data (bytes) into Rust's `Result<uuid::Uuid, uuid::Error>`
+pub fn decode_timeuuid(bytes: &[u8]) -> Result<uuid::Uuid, uuid::Error> {
     uuid::Uuid::from_slice(bytes)
 }
 


Test patch: