Repository: cassandra-rs/cassandra-rs (language: rust)

Issue:
Migrating to futures 0.3
With async/await rolling out into the entire ecosystem, it's time to upgrade existing code to the latest future and to use `std::future`, as that has been stabilized too. I can help out in this too (I have some good amount of free time next weekend)


Discussion / hints:
Thanks - a PR for this would be very welcome indeed! Note that there is some tricky code in here, to convert the C library's own futures into Rust futures.

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cc9685b..995918e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,19 @@ version number is tracked in the file `VERSION`.
 ### Changed
 ### Fixed
 
+## [0.15.0] - 2020-01-??
+### Changed
+- Drops support for futures 0.1, and implements `std::future` instead, allowing
+  you to use this this library inside `async` functions, allowing anything that
+  returns a `CassFuture` to be `await`ed.  This is a breaking change, and will
+  require you to update your call-sites to either use `std::future`, or wrap
+  them with a compatibility shim.
+
+### Added
+- Adds a new method, `Cluster.connect_async` that returns a future, allowing
+  you to connect to the cluster without blocking the event loop.
+
+
 ## [0.14.1] - 2019-11-07
 ### Changed
 - Add code example for SSL.
diff --git a/Cargo.toml b/Cargo.toml
index 8113d4a..93137ed 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,9 +8,10 @@ keywords = [ "Cassandra", "binding", "CQL", "client", "database" ]
 categories = [ "api-bindings", "database", "external-ffi-bindings", "asynchronous" ]
 license = "Apache-2.0"
 name = "cassandra-cpp"
-version = "0.14.1"
+version = "0.15.0"
 authors = ["Tupshin Harper <tupshin@tupshin.com>", "Keith Wansbrough <Keith.Wansbrough@metaswitch.com>"]
 build = "build.rs"
+edition = "2018"
 
 [badges]
 travis-ci = { repository = "Metaswitch/cassandra-rs" }
@@ -23,4 +24,7 @@ decimal = "1"
 time = "0.1"
 uuid = "0.5"
 error-chain = "0.12.1"
-futures = "0.1"
+
+[dev-dependencies]
+tokio = { version = "0.2", features = ["rt-core", "macros", "test-util"] }
+futures = "0.3.1"
diff --git a/build.rs b/build.rs
index 0fbb76a..166d41a 100644
--- a/build.rs
+++ b/build.rs
@@ -11,7 +11,10 @@ fn main() {
     println!("cargo:rustc-flags=-l dylib=stdc++");
     println!("cargo:rustc-flags=-l dylib=uv");
     println!("cargo:rustc-link-search={}", "/usr/lib/x86_64-linux-gnu");
-    println!("cargo:rustc-link-search={}", "/usr/local/lib/x86_64-linux-gnu");
+    println!(
+        "cargo:rustc-link-search={}",
+        "/usr/local/lib/x86_64-linux-gnu"
+    );
     println!("cargo:rustc-link-search={}", "/usr/local/lib64");
     println!("cargo:rustc-link-search={}", "/usr/local/lib");
     println!("cargo:rustc-link-search={}", "/usr/lib64/");
diff --git a/examples/collections.rs b/examples/collections.rs
index 300b96b..1d35389 100644
--- a/examples/collections.rs
+++ b/examples/collections.rs
@@ -1,10 +1,6 @@
 //! Simple example demonstrating the use of set/map/list values in both
 //! bindings and results.
-extern crate cassandra_cpp;
-extern crate futures;
-
 use cassandra_cpp::*;
-use futures::Future;
 use std::collections::hash_map::HashMap;
 
 fn do_work(session: &Session) -> Result<()> {
@@ -42,18 +38,20 @@ fn do_work(session: &Session) -> Result<()> {
             let maybe_iter: Result<MapIterator> = row.get_by_name("addresses");
             match maybe_iter {
                 Err(_) => HashMap::new(),
-                Ok(addresses_iter) => {
-                    addresses_iter
-                        .map(|(k, v)| Ok((k.get_string()?, v.get_string()?)))
-                        .collect::<Result<_>>()?
-                }
+                Ok(addresses_iter) => addresses_iter
+                    .map(|(k, v)| Ok((k.get_string()?, v.get_string()?)))
+                    .collect::<Result<_>>()?,
             }
         };
         let emails_iter: SetIterator = row.get_by_name("email")?;
-        let emails: Vec<String> = emails_iter.map(|v| Ok(v.get_string()?)).collect::<Result<_>>()?;
+        let emails: Vec<String> = emails_iter
+            .map(|v| Ok(v.get_string()?))
+            .collect::<Result<_>>()?;
         let last_name: String = row.get_by_name("last_name")?;
         let phone_numbers_iter: SetIterator = row.get_by_name("phone_numbers")?;
-        let phone_numbers: Vec<String> = phone_numbers_iter.map(|v| Ok(v.get_string()?)).collect::<Result<_>>()?;
+        let phone_numbers: Vec<String> = phone_numbers_iter
+            .map(|v| Ok(v.get_string()?))
+            .collect::<Result<_>>()?;
         let title: i32 = row.get_by_name("title")?;
         println!(
             " == {} {:?} {:?} {} {:?} {}",
diff --git a/examples/disabled/callbacks.rs b/examples/disabled/callbacks.rs
index 1243b9f..972010c 100644
--- a/examples/disabled/callbacks.rs
+++ b/examples/disabled/callbacks.rs
@@ -1,15 +1,12 @@
-#![allow(unstable)]
-extern crate cql_ffi;
+use cassandra::*;
 use std::ffi::CString;
 use std::slice;
-use cassandra::*;
 
 //~ uv_mutex_t mutex;
 //~ uv_cond_t cond;
 //~ Future* close_future = NULL;
 //~ UuidGen* uuid_gen = NULL;
 
-
 fn wait_exit() {
     uv_mutex_lock(&mutex);
     while (close_future == NULL) {
@@ -46,7 +43,6 @@ unsafe fn create_cluster() -> *mut Cluster {
     cluster
 }
 
-
 fn connect_session(session: Session, cluster: &Cluster, callback: FutureCallback) {
     let future = cass_session_connect_keyspace(session, cluster, "examples");
     cass_future_set_callback(future, callback, session);
@@ -69,10 +65,12 @@ fn on_session_connect(future: Future, data: void) {
         uv_cond_signal(&cond);
         return;
     }
-    execute_query(session,
-                  "CREATE KEYSPACE examples WITH replication = {\'class\': \'SimpleStrategy\', \
-                   \'replication_factor\': \'3\' };",
-                  on_create_keyspace);
+    execute_query(
+        session,
+        "CREATE KEYSPACE examples WITH replication = {\'class\': \'SimpleStrategy\', \
+         \'replication_factor\': \'3\' };",
+        on_create_keyspace,
+    );
 }
 
 fn on_create_keyspace(future: Future, data: void) {
@@ -80,9 +78,11 @@ fn on_create_keyspace(future: Future, data: void) {
     if (code != CASS_OK) {
         print_error(future);
     }
-    execute_query(data,
-                  "CREATE TABLE callbacks (key timeuuid PRIMARY KEY, value bigint)",
-                  on_create_table);
+    execute_query(
+        data,
+        "CREATE TABLE callbacks (key timeuuid PRIMARY KEY, value bigint)",
+        on_create_table,
+    );
 }
 
 fn on_create_table(future: Future, data: Session) {
@@ -146,7 +146,7 @@ fn main() {
     uv_mutex_init(&mutex);
     uv_cond_init(&cond);
     connect_session(session, cluster, on_session_connect);
-/* Code running in parallel with queries */
+    /* Code running in parallel with queries */
     wait_exit();
     uv_cond_destroy(&cond);
     uv_mutex_destroy(&mutex);
diff --git a/examples/disabled/logging.rs b/examples/disabled/logging.rs
index e73f321..2e1c4b4 100644
--- a/examples/disabled/logging.rs
+++ b/examples/disabled/logging.rs
@@ -1,5 +1,3 @@
-extern crate cassandra;
-
 use std::slice;
 use std::str::FromStr;
 
@@ -10,7 +8,7 @@ fn print_error(future: &mut Future) {
     println!("Error: {:?}", message);
 }
 
-unsafe fn create_cluster() -> Result<CassError,Cluster> {
+unsafe fn create_cluster() -> Result<CassError, Cluster> {
     let cluster = Cluster::default();
     cluster.set_contact_points("127.0.0.1,127.0.0.2,127.0.0.3")?;
     cluster
@@ -24,12 +22,12 @@ unsafe fn connect_session(session: &mut Session, cluster: &mut Cluster) -> CassE
 
 //~ fn on_log(message:&CassLogMessage, data:data) {
 
-    //~ println!("{}",
-        //~ message.time_ms / 1000,
-        //~ message->time_ms % 1000,
-        //~ cass_log_level_string(message.severity),
-        //~ message.file, message.line, message.function,
-        //~ message.message);
+//~ println!("{}",
+//~ message.time_ms / 1000,
+//~ message->time_ms % 1000,
+//~ cass_log_level_string(message.severity),
+//~ message.file, message.line, message.function,
+//~ message.message);
 //~ }
 
 fn main() {
@@ -38,9 +36,9 @@ fn main() {
     //~ Future* close_future = NULL;
     //~ FILE* log_file = fopen("driver.log", "w+");
     //~ if (log_file == NULL) {
-        //~ fprintf(stderr, "Unable to open log file\n");
+    //~ fprintf(stderr, "Unable to open log file\n");
     //~ }
-/* Log configuration *MUST* be done before any other driver call */
+    /* Log configuration *MUST* be done before any other driver call */
     use CassLogLevel::*;
     cass_log_set_level(CASS_LOG_INFO);
     cass_log_set_callback(on_log, log_file);
@@ -56,7 +54,7 @@ fn main() {
     cass_future_free(close_future);
     cass_cluster_free(cluster);
     cass_session_free(session);
-/* This *MUST* be the last driver call */
+    /* This *MUST* be the last driver call */
     cass_log_cleanup();
     fclose(log_file);
     return 0;
diff --git a/examples/disabled/udt.rs b/examples/disabled/udt.rs
index 66103f7..372ebbc 100644
--- a/examples/disabled/udt.rs
+++ b/examples/disabled/udt.rs
@@ -1,41 +1,38 @@
-extern crate cassandra;
-
 use cassandra::*;
 
 fn main() {
-
     let mut cluster = Cluster::new();
     cluster.set_contact_points("127.0.0.1").unwrap();
 
     match cluster.connect() {
         Ok(ref mut session) => {
-		    let schema = session.get_schema();
-    session.execute(
-        "CREATE KEYSPACE examples WITH replication = \
-        { 'class': 'SimpleStrategy', 'replication_factor': '3' }",
-        0
-    );
+            let schema = session.get_schema();
+            session.execute(
+                "CREATE KEYSPACE examples WITH replication = \
+                 { 'class': 'SimpleStrategy', 'replication_factor': '3' }",
+                0,
+            );
 
-    session.execute(
-        "CREATE TYPE examples.phone_numbers (phone1 int, phone2 int)",
-        0
-    );
+            session.execute(
+                "CREATE TYPE examples.phone_numbers (phone1 int, phone2 int)",
+                0,
+            );
 
-    session.execute(
-        "CREATE TYPE examples.address \
-        (street text, city text, zip int, phone set<frozen<phone_numbers>>)"
-        ,0
-    );
+            session.execute(
+                "CREATE TYPE examples.address \
+                 (street text, city text, zip int, phone set<frozen<phone_numbers>>)",
+                0,
+            );
 
-    session.execute(
-        "CREATE TABLE examples.udt (id timeuuid, address frozen<address>, PRIMARY KEY(id))",
-        0
-    );
+            session.execute(
+                "CREATE TABLE examples.udt (id timeuuid, address frozen<address>, PRIMARY KEY(id))",
+                0,
+            );
 
-    insert_into_udt(&session, schema).unwrap();
-    select_from_udt(&session).unwrap();
-    session.close().wait().unwrap();
-}
+            insert_into_udt(&session, schema).unwrap();
+            select_from_udt(&session).unwrap();
+            session.close().wait().unwrap();
+        }
         err => println!("{:?}", err),
     }
 }
@@ -58,19 +55,19 @@ fn select_from_udt(session: &Session) -> Result<(), CassandraError> {
                     match field.1.get_type() {
                         ValueType::VARCHAR => println!("{}", try!(field.1.get_string())),
                         ValueType::INT => println!("{}", try!(field.1.get_int32())),
-                        ValueType::SET =>
+                        ValueType::SET => {
                             for phone_numbers in try!(field.1.as_set_iterator()) {
-                            for phone_number in try!(phone_numbers.as_user_type_iterator()) {
-                                let phone_number_value = phone_number.1;
-                                println!("{}", phone_number_value);
+                                for phone_number in try!(phone_numbers.as_user_type_iterator()) {
+                                    let phone_number_value = phone_number.1;
+                                    println!("{}", phone_number_value);
+                                }
                             }
-                        },
+                        }
                         other => panic!("Unsupported type: {:?}", other),
                     }
                 }
             }
             Ok(())
-
         }
     }
 }
@@ -90,7 +87,9 @@ fn insert_into_udt(session: &Session) -> Result<(), CassandraError> {
     phone_numbers.set_int32_by_name("phone2", 0 + 2).unwrap();
     phone.append_user_type(phone_numbers).unwrap();
     address.set_string_by_name("street", &id_str).unwrap();
-    address.set_int32_by_name("zip", id.0.time_and_version as i32).unwrap();
+    address
+        .set_int32_by_name("zip", id.0.time_and_version as i32)
+        .unwrap();
     address.set_collection_by_name("phone", phone).unwrap();
 
     statement.bind(0, id).unwrap();
diff --git a/examples/schema_meta.rs b/examples/schema_meta.rs
index 90070c9..30d8e6b 100644
--- a/examples/schema_meta.rs
+++ b/examples/schema_meta.rs
@@ -1,16 +1,17 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 use cassandra_cpp::*;
 
-use futures::Future;
-
-
-fn print_function(session: &Session, keyspace: &str, function: &str, arguments: Vec<&str>) -> Result<()> {
+fn print_function(
+    session: &Session,
+    keyspace: &str,
+    function: &str,
+    arguments: Vec<&str>,
+) -> Result<()> {
     let schema_meta = session.get_schema_meta();
     let keyspace_meta: KeyspaceMeta = schema_meta.get_keyspace_by_name(keyspace);
 
-    let function_meta = keyspace_meta.get_function_by_name(function, arguments).unwrap();
+    let function_meta = keyspace_meta
+        .get_function_by_name(function, arguments)
+        .unwrap();
     print_function_meta(function_meta, 0);
     Ok(())
 }
@@ -66,7 +67,6 @@ fn print_meta_fields(iterator: FieldIterator, indent: i32) {
         println!("{}: ", item.name);
         print_schema_value(item.value);
         println!("");
-
     }
 }
 
@@ -95,7 +95,6 @@ fn print_schema_value(value: Value) {
         _ => "<unhandled type>".to_owned(),
     };
     print!("{}", value);
-
 }
 
 // fn print_schema_bytes(bytes: &[u8]) {
@@ -115,22 +114,31 @@ fn cass() -> Result<()> {
     cluster.set_contact_points("127.0.0.1").unwrap();
     cluster.set_load_balance_round_robin();
 
-    let create_ks = stmt!("CREATE KEYSPACE IF NOT EXISTS examples WITH replication = { \'class\': \
-                           \'SimpleStrategy\', \'replication_factor\': \'1\' };");
-    let create_table = stmt!("CREATE TABLE IF NOT EXISTS examples.schema_meta (key text, value bigint, PRIMARY KEY \
-                              (key));");
-
-    let create_func1 = stmt!("CREATE FUNCTION IF NOT EXISTS examples.avg_state(state tuple<int, bigint>, val int) \
-                              CALLED ON NULL INPUT RETURNS tuple<int, bigint> LANGUAGE java AS 'if (val != null) { \
-                              state.setInt(0, state.getInt(0) + 1); state.setLong(1, state.getLong(1) + \
-                              val.intValue()); } return state;';");
-    let create_func2 = stmt!("CREATE FUNCTION IF NOT EXISTS examples.avg_final (state tuple<int, bigint>) CALLED ON \
-                              NULL INPUT RETURNS double LANGUAGE java AS 'double r = 0; if (state.getInt(0) == 0) \
-                              return null; r = state.getLong(1); r /= state.getInt(0); return Double.valueOf(r);';");
-
-    let create_aggregate = stmt!("CREATE AGGREGATE examples.average(int) SFUNC avg_state STYPE tuple<int, bigint> \
-                                  FINALFUNC avg_final INITCOND(0, 0);");
-
+    let create_ks = stmt!(
+        "CREATE KEYSPACE IF NOT EXISTS examples WITH replication = { \'class\': \
+         \'SimpleStrategy\', \'replication_factor\': \'1\' };"
+    );
+    let create_table = stmt!(
+        "CREATE TABLE IF NOT EXISTS examples.schema_meta (key text, value bigint, PRIMARY KEY \
+         (key));"
+    );
+
+    let create_func1 = stmt!(
+        "CREATE FUNCTION IF NOT EXISTS examples.avg_state(state tuple<int, bigint>, val int) \
+         CALLED ON NULL INPUT RETURNS tuple<int, bigint> LANGUAGE java AS 'if (val != null) { \
+         state.setInt(0, state.getInt(0) + 1); state.setLong(1, state.getLong(1) + \
+         val.intValue()); } return state;';"
+    );
+    let create_func2 = stmt!(
+        "CREATE FUNCTION IF NOT EXISTS examples.avg_final (state tuple<int, bigint>) CALLED ON \
+         NULL INPUT RETURNS double LANGUAGE java AS 'double r = 0; if (state.getInt(0) == 0) \
+         return null; r = state.getLong(1); r /= state.getInt(0); return Double.valueOf(r);';"
+    );
+
+    let create_aggregate = stmt!(
+        "CREATE AGGREGATE examples.average(int) SFUNC avg_state STYPE tuple<int, bigint> \
+         FINALFUNC avg_final INITCOND(0, 0);"
+    );
 
     match cluster.connect() {
         Ok(ref mut session) => {
@@ -144,10 +152,12 @@ fn cass() -> Result<()> {
             let keyspace = schema.get_keyspace_by_name("examples");
             let mut table = keyspace.table_by_name("schema_meta").unwrap();
             print_table_meta(&mut table, 0);
-            print_function(session,
-                           "examples",
-                           "avg_state",
-                           vec!["tuple<int,bigint>", "int"])?;
+            print_function(
+                session,
+                "examples",
+                "avg_state",
+                vec!["tuple<int,bigint>", "int"],
+            )?;
             print_function(session, "examples", "avg_final", vec!["tuple<int,bigint>"])?;
             print_aggregate(session, "examples", "average", vec!["int"])?;
             Ok(())
@@ -156,12 +166,18 @@ fn cass() -> Result<()> {
     }
 }
 
-
-fn print_aggregate(session: &Session, keyspace: &str, aggregate: &str, arguments: Vec<&str>) -> Result<()> {
+fn print_aggregate(
+    session: &Session,
+    keyspace: &str,
+    aggregate: &str,
+    arguments: Vec<&str>,
+) -> Result<()> {
     let schema_meta = session.get_schema_meta();
     let keyspace_meta = schema_meta.get_keyspace_by_name(keyspace);
 
-    let aggregate_meta = keyspace_meta.aggregate_by_name(aggregate, arguments).unwrap();
+    let aggregate_meta = keyspace_meta
+        .aggregate_by_name(aggregate, arguments)
+        .unwrap();
     print_aggregate_meta(aggregate_meta, 0);
     Ok(())
     //    } else {
@@ -216,7 +232,6 @@ fn print_keyspace_meta(keyspace_meta: &mut KeyspaceMeta, indent: i32) {
     print_meta_fields(keyspace_meta.fields_iter(), indent + 1);
     println!("");
 
-
     for mut table_meta in keyspace_meta.table_iter() {
         print_table_meta(&mut table_meta, indent + 1);
     }
diff --git a/examples/simple.rs b/examples/simple.rs
index 9e28c86..3f833e9 100644
--- a/examples/simple.rs
+++ b/examples/simple.rs
@@ -1,11 +1,5 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 use cassandra_cpp::*;
 
-use futures::Future;
-
-
 fn main() {
     let query = stmt!("SELECT keyspace_name FROM system_schema.keyspaces;");
     let col_name = "keyspace_name";
diff --git a/examples/simple_async.rs b/examples/simple_async.rs
new file mode 100644
index 0000000..fd24941
--- /dev/null
+++ b/examples/simple_async.rs
@@ -0,0 +1,24 @@
+use cassandra_cpp::*;
+#[tokio::main]
+async fn main() {
+    let query = stmt!("SELECT keyspace_name FROM system_schema.keyspaces;");
+    let col_name = "keyspace_name";
+
+    let contact_points = "127.0.0.1";
+
+    let mut cluster = Cluster::default();
+    cluster.set_contact_points(contact_points).unwrap();
+    cluster.set_load_balance_round_robin();
+
+    match cluster.connect_async().await {
+        Ok(ref mut session) => {
+            let result = session.execute(&query).await.unwrap();
+            println!("{}", result);
+            for row in result.iter() {
+                let col: String = row.get_by_name(col_name).unwrap();
+                println!("ks name = {}", col);
+            }
+        }
+        err => println!("{:?}", err),
+    }
+}
diff --git a/examples/ssl.rs b/examples/ssl.rs
index aa65481..2235a3e 100755
--- a/examples/ssl.rs
+++ b/examples/ssl.rs
@@ -1,8 +1,4 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 use cassandra_cpp::*;
-use futures::Future;
 use std::fs;
 
 fn main() {
diff --git a/rustfmt.toml b/rustfmt.toml
deleted file mode 100644
index f830693..0000000
--- a/rustfmt.toml
+++ /dev/null
@@ -1,33 +0,0 @@
-max_width = 120
-ideal_width = 100
-leeway = 5
-tab_spaces = 4
-newline_style = "Unix"
-fn_brace_style = "PreferSameLine"
-fn_return_indent = "WithArgs"
-fn_args_paren_newline = true
-fn_args_density = "Compressed"
-fn_args_layout = "Visual"
-fn_arg_indent = "Tabbed"
-where_density = "Tall"
-where_indent = "Tabbed"
-where_layout = "Horizontal"
-where_pred_indent = "Visual"
-generics_indent = "Visual"
-struct_trailing_comma = "Vertical"
-struct_lit_trailing_comma = "Vertical"
-struct_lit_style = "Block"
-enum_trailing_comma = true
-report_todo = "Always"
-report_fixme = "Never"
-expr_indent_style = "Tabbed"
-closure_indent_style = "Visual"
-single_line_if_else = true
-format_strings = true
-density = "Compressed"
-rewrite_if_else = true
-fn_empty_single_line = true
-use_try_shorthand = true
-fn_single_line = true
-reorder_imports = true
-reorder_imported_names = true
diff --git a/src/cassandra/batch.rs b/src/cassandra/batch.rs
index e5ede3a..bec3c04 100644
--- a/src/cassandra/batch.rs
+++ b/src/cassandra/batch.rs
@@ -1,28 +1,27 @@
-use cassandra::consistency::Consistency;
-use cassandra::policy::retry::RetryPolicy;
-use cassandra::statement::Statement;
-use cassandra::util::Protected;
-use cassandra::error::*;
-
-use cassandra_sys::CassBatch as _Batch;
-use cassandra_sys::CassBatchType_;
-use cassandra_sys::CassConsistency;
-use cassandra_sys::CassCustomPayload as _CassCustomPayload;
-use cassandra_sys::cass_batch_add_statement;
-use cassandra_sys::cass_batch_free;
-use cassandra_sys::cass_batch_new;
-use cassandra_sys::cass_batch_set_consistency;
-use cassandra_sys::cass_batch_set_custom_payload;
-use cassandra_sys::cass_batch_set_retry_policy;
-use cassandra_sys::cass_batch_set_serial_consistency;
-use cassandra_sys::cass_batch_set_timestamp;
-use cassandra_sys::cass_custom_payload_free;
-use cassandra_sys::cass_custom_payload_new;
-use cassandra_sys::cass_custom_payload_set;
+use crate::cassandra::consistency::Consistency;
+use crate::cassandra::error::*;
+use crate::cassandra::policy::retry::RetryPolicy;
+use crate::cassandra::statement::Statement;
+use crate::cassandra::util::Protected;
+
+use crate::cassandra_sys::cass_batch_add_statement;
+use crate::cassandra_sys::cass_batch_free;
+use crate::cassandra_sys::cass_batch_new;
+use crate::cassandra_sys::cass_batch_set_consistency;
+use crate::cassandra_sys::cass_batch_set_custom_payload;
+use crate::cassandra_sys::cass_batch_set_retry_policy;
+use crate::cassandra_sys::cass_batch_set_serial_consistency;
+use crate::cassandra_sys::cass_batch_set_timestamp;
+use crate::cassandra_sys::cass_custom_payload_free;
+use crate::cassandra_sys::cass_custom_payload_new;
+use crate::cassandra_sys::cass_custom_payload_set;
+use crate::cassandra_sys::CassBatch as _Batch;
+use crate::cassandra_sys::CassBatchType_;
+use crate::cassandra_sys::CassConsistency;
+use crate::cassandra_sys::CassCustomPayload as _CassCustomPayload;
 use std::ffi::CString;
 use std::ffi::NulError;
 
-
 /// A group of statements that are executed as a single batch.
 /// <b>Note:</b> Batches are not supported by the binary protocol version 1.
 #[derive(Debug)]
@@ -33,8 +32,15 @@ pub struct Batch(*mut _Batch);
 unsafe impl Send for Batch {}
 
 impl Protected<*mut _Batch> for Batch {
-    fn inner(&self) -> *mut _Batch { self.0 }
-    fn build(inner: *mut _Batch) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Batch(inner) }
+    fn inner(&self) -> *mut _Batch {
+        self.0
+    }
+    fn build(inner: *mut _Batch) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Batch(inner)
+    }
 }
 
 /// Custom payloads not fully supported yet
@@ -42,83 +48,88 @@ impl Protected<*mut _Batch> for Batch {
 pub struct CustomPayload(*mut _CassCustomPayload);
 
 impl Protected<*mut _CassCustomPayload> for CustomPayload {
-    fn inner(&self) -> *mut _CassCustomPayload { self.0 }
-    fn build(inner: *mut _CassCustomPayload) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; CustomPayload(inner) }
+    fn inner(&self) -> *mut _CassCustomPayload {
+        self.0
+    }
+    fn build(inner: *mut _CassCustomPayload) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        CustomPayload(inner)
+    }
 }
 
 impl Default for CustomPayload {
     /// creates a new custom payload
-    fn default() -> Self { unsafe { CustomPayload(cass_custom_payload_new()) } }
+    fn default() -> Self {
+        unsafe { CustomPayload(cass_custom_payload_new()) }
+    }
 }
 impl CustomPayload {
     /// Sets an item to the custom payload.
     pub fn set(&self, name: String, value: &[u8]) -> Result<()> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            Ok(cass_custom_payload_set(self.0,
-                                       name_cstr.as_ptr(),
-                                       value.as_ptr(),
-                                       value.len()))
+            Ok(cass_custom_payload_set(
+                self.0,
+                name_cstr.as_ptr(),
+                value.as_ptr(),
+                value.len(),
+            ))
         }
     }
 }
 
 impl Drop for CustomPayload {
-    fn drop(&mut self) { unsafe { cass_custom_payload_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_custom_payload_free(self.0) }
+    }
 }
 
 impl Drop for Batch {
     /// Frees a batch instance. Batches can be immediately freed after being
     /// executed.
-    fn drop(&mut self) { unsafe { cass_batch_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_batch_free(self.0) }
+    }
 }
 
 impl Batch {
     /// Creates a new batch statement with batch type.
-    pub fn new(batch_type: BatchType) -> Batch { unsafe { Batch(cass_batch_new(batch_type.inner())) } }
+    pub fn new(batch_type: BatchType) -> Batch {
+        unsafe { Batch(cass_batch_new(batch_type.inner())) }
+    }
 
     /// Sets the batch's consistency level
     pub fn set_consistency(&mut self, consistency: Consistency) -> Result<&mut Self> {
-        unsafe {
-            cass_batch_set_consistency(self.0, consistency.inner()).to_result(self)
-        }
+        unsafe { cass_batch_set_consistency(self.0, consistency.inner()).to_result(self) }
     }
 
     /// Sets the batch's serial consistency level.
     ///
     /// <b>Default:</b> Not set
     pub fn set_serial_consistency(&mut self, consistency: Consistency) -> Result<&mut Self> {
-        unsafe {
-            cass_batch_set_serial_consistency(self.0, consistency.inner()).to_result(self)
-        }
+        unsafe { cass_batch_set_serial_consistency(self.0, consistency.inner()).to_result(self) }
     }
 
     /// Sets the batch's timestamp.
     pub fn set_timestamp(&mut self, timestamp: i64) -> Result<&Self> {
-        unsafe {
-            cass_batch_set_timestamp(self.0, timestamp).to_result(self)
-        }
+        unsafe { cass_batch_set_timestamp(self.0, timestamp).to_result(self) }
     }
 
     /// Sets the batch's retry policy.
     pub fn set_retry_policy(&mut self, retry_policy: RetryPolicy) -> Result<&mut Self> {
-        unsafe {
-            cass_batch_set_retry_policy(self.0, retry_policy.inner()).to_result(self)
-        }
+        unsafe { cass_batch_set_retry_policy(self.0, retry_policy.inner()).to_result(self) }
     }
 
     /// Sets the batch's custom payload.
     pub fn set_custom_payload(&mut self, custom_payload: CustomPayload) -> Result<&mut Self> {
-        unsafe {
-            cass_batch_set_custom_payload(self.0, custom_payload.0).to_result(self)
-        }
+        unsafe { cass_batch_set_custom_payload(self.0, custom_payload.0).to_result(self) }
     }
 
     /// Adds a statement to a batch.
     pub fn add_statement(&mut self, statement: &Statement) -> Result<&Self> {
-        unsafe {
-            cass_batch_add_statement(self.0, statement.inner()).to_result(self)
-        }
+        unsafe { cass_batch_add_statement(self.0, statement.inner()).to_result(self) }
     }
 }
 
diff --git a/src/cassandra/cluster.rs b/src/cassandra/cluster.rs
index e6ccf47..a2a95ac 100644
--- a/src/cassandra/cluster.rs
+++ b/src/cassandra/cluster.rs
@@ -1,66 +1,64 @@
+use crate::cassandra::error::*;
+use crate::cassandra::future::CassFuture;
+use crate::cassandra::policy::retry::RetryPolicy;
+use crate::cassandra::session::Session;
+use crate::cassandra::ssl::Ssl;
+use crate::cassandra::time::TimestampGen;
+use crate::cassandra::util::Protected;
+
+use crate::cassandra_sys::cass_cluster_free;
+use crate::cassandra_sys::cass_cluster_new;
+use crate::cassandra_sys::cass_cluster_set_connect_timeout;
+use crate::cassandra_sys::cass_cluster_set_connection_heartbeat_interval;
+use crate::cassandra_sys::cass_cluster_set_connection_idle_timeout;
+use crate::cassandra_sys::cass_cluster_set_contact_points;
+use crate::cassandra_sys::cass_cluster_set_core_connections_per_host;
+use crate::cassandra_sys::cass_cluster_set_credentials;
+use crate::cassandra_sys::cass_cluster_set_latency_aware_routing;
+use crate::cassandra_sys::cass_cluster_set_latency_aware_routing_settings;
+use crate::cassandra_sys::cass_cluster_set_load_balance_dc_aware;
+use crate::cassandra_sys::cass_cluster_set_load_balance_round_robin;
+use crate::cassandra_sys::cass_cluster_set_local_address;
+use crate::cassandra_sys::cass_cluster_set_max_concurrent_creation;
+use crate::cassandra_sys::cass_cluster_set_max_concurrent_requests_threshold;
+use crate::cassandra_sys::cass_cluster_set_max_connections_per_host;
+use crate::cassandra_sys::cass_cluster_set_max_requests_per_flush;
+use crate::cassandra_sys::cass_cluster_set_num_threads_io;
+use crate::cassandra_sys::cass_cluster_set_pending_requests_high_water_mark;
+use crate::cassandra_sys::cass_cluster_set_pending_requests_low_water_mark;
+use crate::cassandra_sys::cass_cluster_set_port;
+use crate::cassandra_sys::cass_cluster_set_protocol_version;
+use crate::cassandra_sys::cass_cluster_set_queue_size_event;
+use crate::cassandra_sys::cass_cluster_set_queue_size_io;
+use crate::cassandra_sys::cass_cluster_set_reconnect_wait_time;
+use crate::cassandra_sys::cass_cluster_set_request_timeout;
+use crate::cassandra_sys::cass_cluster_set_retry_policy;
+use crate::cassandra_sys::cass_cluster_set_ssl;
+use crate::cassandra_sys::cass_cluster_set_tcp_keepalive;
+use crate::cassandra_sys::cass_cluster_set_tcp_nodelay;
+use crate::cassandra_sys::cass_cluster_set_timestamp_gen;
+use crate::cassandra_sys::cass_cluster_set_token_aware_routing;
+use crate::cassandra_sys::cass_cluster_set_use_schema;
+use crate::cassandra_sys::cass_cluster_set_whitelist_filtering;
+use crate::cassandra_sys::cass_cluster_set_write_bytes_high_water_mark;
+use crate::cassandra_sys::cass_cluster_set_write_bytes_low_water_mark;
+use crate::cassandra_sys::cass_false;
+use crate::cassandra_sys::cass_future_error_code;
+use crate::cassandra_sys::cass_session_connect;
+use crate::cassandra_sys::cass_session_new;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::CassCluster as _Cluster;
 
-use cassandra::future::CassFuture;
-use cassandra::policy::retry::RetryPolicy;
-use cassandra::session::Session;
-use cassandra::ssl::Ssl;
-use cassandra::time::TimestampGen;
-use cassandra::util::Protected;
-use cassandra::error::*;
-
-use cassandra_sys::CassCluster as _Cluster;
-use cassandra_sys::cass_cluster_free;
-use cassandra_sys::cass_cluster_new;
-use cassandra_sys::cass_cluster_set_connect_timeout;
-use cassandra_sys::cass_cluster_set_connection_heartbeat_interval;
-use cassandra_sys::cass_cluster_set_connection_idle_timeout;
-use cassandra_sys::cass_cluster_set_contact_points;
-use cassandra_sys::cass_cluster_set_local_address;
-use cassandra_sys::cass_cluster_set_core_connections_per_host;
-use cassandra_sys::cass_cluster_set_credentials;
-use cassandra_sys::cass_cluster_set_latency_aware_routing;
-use cassandra_sys::cass_cluster_set_latency_aware_routing_settings;
-use cassandra_sys::cass_cluster_set_load_balance_dc_aware;
-use cassandra_sys::cass_cluster_set_load_balance_round_robin;
-use cassandra_sys::cass_cluster_set_max_concurrent_creation;
-use cassandra_sys::cass_cluster_set_max_concurrent_requests_threshold;
-use cassandra_sys::cass_cluster_set_max_connections_per_host;
-use cassandra_sys::cass_cluster_set_max_requests_per_flush;
-use cassandra_sys::cass_cluster_set_num_threads_io;
-use cassandra_sys::cass_cluster_set_pending_requests_high_water_mark;
-use cassandra_sys::cass_cluster_set_pending_requests_low_water_mark;
-use cassandra_sys::cass_cluster_set_port;
-use cassandra_sys::cass_cluster_set_protocol_version;
-use cassandra_sys::cass_cluster_set_queue_size_event;
-use cassandra_sys::cass_cluster_set_queue_size_io;
-use cassandra_sys::cass_cluster_set_reconnect_wait_time;
-use cassandra_sys::cass_cluster_set_request_timeout;
-use cassandra_sys::cass_cluster_set_retry_policy;
-use cassandra_sys::cass_cluster_set_ssl;
-use cassandra_sys::cass_cluster_set_tcp_keepalive;
-use cassandra_sys::cass_cluster_set_tcp_nodelay;
-use cassandra_sys::cass_cluster_set_timestamp_gen;
-use cassandra_sys::cass_cluster_set_token_aware_routing;
-use cassandra_sys::cass_cluster_set_use_schema;
-use cassandra_sys::cass_cluster_set_whitelist_filtering;
-use cassandra_sys::cass_cluster_set_write_bytes_high_water_mark;
-use cassandra_sys::cass_cluster_set_write_bytes_low_water_mark;
-use cassandra_sys::cass_false;
-use cassandra_sys::cass_future_error_code;
-use cassandra_sys::cass_session_connect;
-use cassandra_sys::cass_session_new;
-use cassandra_sys::cass_true;
-
-use std::ffi::{CString, CStr};
 use std::ffi::NulError;
+use std::ffi::{CStr, CString};
 use std::fmt;
+use std::fmt::Display;
 use std::iter::Map;
 use std::net::AddrParseError;
 use std::net::Ipv4Addr;
 use std::result;
-use std::fmt::Display;
 use std::str::FromStr;
 use time::Duration;
-use futures::Future;
 
 /// A CQL protocol version is just an integer.
 pub type CqlProtocol = i32;
@@ -86,17 +84,28 @@ unsafe impl Send for Cluster {}
 
 impl Drop for Cluster {
     /// Frees a cluster instance.
-    fn drop(&mut self) { unsafe { cass_cluster_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_cluster_free(self.0) }
+    }
 }
 
 impl Protected<*mut _Cluster> for Cluster {
-    fn inner(&self) -> *mut _Cluster { self.0 }
-    fn build(inner: *mut _Cluster) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Cluster(inner) }
+    fn inner(&self) -> *mut _Cluster {
+        self.0
+    }
+    fn build(inner: *mut _Cluster) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Cluster(inner)
+    }
 }
 
 impl Default for Cluster {
     /// Creates a new cluster
-    fn default() -> Cluster { unsafe { Cluster(cass_cluster_new()) } }
+    fn default() -> Cluster {
+        unsafe { Cluster(cass_cluster_new()) }
+    }
 }
 
 impl Cluster {
@@ -129,7 +138,6 @@ impl Cluster {
         }
     }
 
-
     /// Sets the port
     ///
     ///
@@ -139,7 +147,6 @@ impl Cluster {
         unsafe { cass_cluster_set_port(self.0, port as i32).to_result(self) }
     }
 
-
     /// Sets the SSL context and enables SSL
     pub fn set_ssl(&mut self, ssl: &mut Ssl) -> &Self {
         unsafe {
@@ -153,7 +160,18 @@ impl Cluster {
         unsafe {
             let session = Session(cass_session_new());
             let connect_future = <CassFuture<()>>::build(cass_session_connect(session.0, self.0));
-            connect_future.wait().map(|_| session)
+            connect_future.wait()?;
+            Ok(session)
+        }
+    }
+
+    /// Asynchronously connects to the cassandra cluster
+    pub async fn connect_async(&mut self) -> Result<Session> {
+        unsafe {
+            let session = Session(cass_session_new());
+            let connect_future = <CassFuture<()>>::build(cass_session_connect(session.0, self.0));
+            connect_future.await?;
+            Ok(session)
         }
     }
 
@@ -165,8 +183,7 @@ impl Cluster {
     ///
     pub fn set_protocol_version(&mut self, protocol_version: CqlProtocol) -> Result<&mut Self> {
         unsafe {
-            cass_cluster_set_protocol_version(self.0, protocol_version as i32)
-                .to_result(self)
+            cass_cluster_set_protocol_version(self.0, protocol_version as i32).to_result(self)
         }
     }
 
@@ -177,10 +194,7 @@ impl Cluster {
     /// Default: 1
     ///
     pub fn set_num_threads_io(&mut self, num_threads: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_cluster_set_num_threads_io(self.0, num_threads)
-                .to_result(self)
-        }
+        unsafe { cass_cluster_set_num_threads_io(self.0, num_threads).to_result(self) }
     }
 
     /// Sets the size of the fixed size queue that stores pending requests.
@@ -189,10 +203,7 @@ impl Cluster {
     /// Default: 8192
     ///
     pub fn set_queue_size_io(&mut self, queue_size: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_cluster_set_queue_size_io(self.0, queue_size)
-                .to_result(self)
-        }
+        unsafe { cass_cluster_set_queue_size_io(self.0, queue_size).to_result(self) }
     }
 
     /// Sets the size of the fixed size queue that stores events.
@@ -201,10 +212,7 @@ impl Cluster {
     /// Default: 8192
     ///
     pub fn set_queue_size_event(&mut self, queue_size: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_cluster_set_queue_size_event(self.0, queue_size)
-                .to_result(self)
-        }
+        unsafe { cass_cluster_set_queue_size_event(self.0, queue_size).to_result(self) }
     }
 
     /// Sets the number of connections made to each server in each
@@ -215,8 +223,7 @@ impl Cluster {
     ///
     pub fn set_core_connections_per_host(&mut self, num_connections: u32) -> Result<&mut Self> {
         unsafe {
-            cass_cluster_set_core_connections_per_host(self.0, num_connections)
-                .to_result(self)
+            cass_cluster_set_core_connections_per_host(self.0, num_connections).to_result(self)
         }
     }
 
@@ -228,8 +235,7 @@ impl Cluster {
     ///
     pub fn set_max_connections_per_host(&mut self, num_connections: u32) -> Result<&mut Self> {
         unsafe {
-            cass_cluster_set_max_connections_per_host(self.0, num_connections)
-                .to_result(self)
+            cass_cluster_set_max_connections_per_host(self.0, num_connections).to_result(self)
         }
     }
 
@@ -252,10 +258,7 @@ impl Cluster {
     ///
     /// Default: 1
     pub fn set_max_concurrent_creation(&mut self, num_connections: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_cluster_set_max_concurrent_creation(self.0, num_connections)
-                .to_result(self)
-        }
+        unsafe { cass_cluster_set_max_concurrent_creation(self.0, num_connections).to_result(self) }
     }
 
     /// Sets the threshold for the maximum number of concurrent requests in-flight
@@ -264,10 +267,12 @@ impl Cluster {
     ///
     ///
     /// Default: 100
-    pub fn set_max_concurrent_requests_threshold(&mut self, num_requests: u32) -> Result<&mut Self> {
+    pub fn set_max_concurrent_requests_threshold(
+        &mut self,
+        num_requests: u32,
+    ) -> Result<&mut Self> {
         unsafe {
-            cass_cluster_set_max_concurrent_requests_threshold(self.0, num_requests)
-                .to_result(self)
+            cass_cluster_set_max_concurrent_requests_threshold(self.0, num_requests).to_result(self)
         }
     }
 
@@ -277,10 +282,7 @@ impl Cluster {
     ///
     /// Default: 128
     pub fn set_max_requests_per_flush(&mut self, num_requests: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_cluster_set_max_requests_per_flush(self.0, num_requests)
-                .to_result(self)
-        }
+        unsafe { cass_cluster_set_max_requests_per_flush(self.0, num_requests).to_result(self) }
     }
 
     /// Sets the high water mark for the number of bytes outstanding
@@ -290,10 +292,7 @@ impl Cluster {
     ///
     /// Default: 64KB
     pub fn set_write_bytes_high_water_mark(&mut self, num_bytes: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_cluster_set_write_bytes_high_water_mark(self.0, num_bytes)
-                .to_result(self)
-        }
+        unsafe { cass_cluster_set_write_bytes_high_water_mark(self.0, num_bytes).to_result(self) }
     }
 
     /// Sets the low water mark for the number of bytes outstanding
@@ -303,10 +302,7 @@ impl Cluster {
     ///
     /// Default: 32KB
     pub fn set_write_bytes_low_water_mark(&mut self, num_bytes: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_cluster_set_write_bytes_low_water_mark(self.0, num_bytes)
-                .to_result(self)
-        }
+        unsafe { cass_cluster_set_write_bytes_low_water_mark(self.0, num_bytes).to_result(self) }
     }
 
     /// Sets the high water mark for the number of requests queued waiting
@@ -318,8 +314,7 @@ impl Cluster {
     /// Default: 256
     pub fn set_pending_requests_high_water_mark(&mut self, num_requests: u32) -> Result<&mut Self> {
         unsafe {
-            cass_cluster_set_pending_requests_high_water_mark(self.0, num_requests)
-                .to_result(self)
+            cass_cluster_set_pending_requests_high_water_mark(self.0, num_requests).to_result(self)
         }
     }
 
@@ -332,8 +327,7 @@ impl Cluster {
     /// Default: 128
     pub fn set_pending_requests_low_water_mark(&mut self, num_requests: u32) -> Result<&mut Self> {
         unsafe {
-            cass_cluster_set_pending_requests_low_water_mark(self.0, num_requests)
-                .to_result(self)
+            cass_cluster_set_pending_requests_low_water_mark(self.0, num_requests).to_result(self)
         }
     }
 
@@ -341,7 +335,7 @@ impl Cluster {
     ///
     ///
     /// Default: 5000ms
-    #[allow(cast_possible_truncation,cast_sign_loss)]
+    #[allow(cast_possible_truncation, cast_sign_loss)]
     pub fn set_connect_timeout(&mut self, timeout: Duration) -> &Self {
         unsafe {
             cass_cluster_set_connect_timeout(self.0, timeout.num_milliseconds() as u32);
@@ -353,7 +347,7 @@ impl Cluster {
     ///
     ///
     /// Default: 12000ms
-    #[allow(cast_possible_truncation,cast_sign_loss)]
+    #[allow(cast_possible_truncation, cast_sign_loss)]
     pub fn set_request_timeout(&mut self, timeout: Duration) -> &Self {
         unsafe {
             cass_cluster_set_request_timeout(self.0, timeout.num_milliseconds() as u32);
@@ -366,9 +360,7 @@ impl Cluster {
         unsafe {
             let username_cstr = CString::new(username)?;
             let password_cstr = CString::new(password)?;
-            cass_cluster_set_credentials(self.0,
-                                         username_cstr.as_ptr(),
-                                         password_cstr.as_ptr());
+            cass_cluster_set_credentials(self.0, username_cstr.as_ptr(), password_cstr.as_ptr());
         }
         Ok(self)
     }
@@ -381,7 +373,6 @@ impl Cluster {
         unsafe {
             cass_cluster_set_load_balance_round_robin(self.0);
             self
-
         }
     }
 
@@ -395,18 +386,27 @@ impl Cluster {
     /// first connected contact point, and no remote hosts are considered in
     /// query plans. If relying on this mechanism, be sure to use only contact
     /// points from the local DC.
-    pub fn set_load_balance_dc_aware<S>(&mut self, local_dc: &str, used_hosts_per_remote_dc: u32,
-        allow_remote_dcs_for_local_cl: bool)
-                                        -> Result<&mut Self> {
+    pub fn set_load_balance_dc_aware<S>(
+        &mut self,
+        local_dc: &str,
+        used_hosts_per_remote_dc: u32,
+        allow_remote_dcs_for_local_cl: bool,
+    ) -> Result<&mut Self> {
         unsafe {
             {
-                    let local_dc = CString::new(local_dc)?;
-                    cass_cluster_set_load_balance_dc_aware(self.0,
-                                                           local_dc.as_ptr(),
-                                                           used_hosts_per_remote_dc,
-                                                           if allow_remote_dcs_for_local_cl { cass_true } else { cass_false })
-                }
-                .to_result(self)
+                let local_dc = CString::new(local_dc)?;
+                cass_cluster_set_load_balance_dc_aware(
+                    self.0,
+                    local_dc.as_ptr(),
+                    used_hosts_per_remote_dc,
+                    if allow_remote_dcs_for_local_cl {
+                        cass_true
+                    } else {
+                        cass_false
+                    },
+                )
+            }
+            .to_result(self)
         }
     }
 
@@ -425,7 +425,10 @@ impl Cluster {
     /// the base load balancing policy.
     pub fn set_token_aware_routing(&mut self, enabled: bool) -> &Self {
         unsafe {
-            cass_cluster_set_token_aware_routing(self.0, if enabled { cass_true } else { cass_false });
+            cass_cluster_set_token_aware_routing(
+                self.0,
+                if enabled { cass_true } else { cass_false },
+            );
         }
         self
     }
@@ -441,12 +444,14 @@ impl Cluster {
     /// placement (token-aware) before considering the latency.
     pub fn set_latency_aware_routing(&mut self, enabled: bool) -> &Self {
         unsafe {
-            cass_cluster_set_latency_aware_routing(self.0, if enabled { cass_true } else { cass_false });
+            cass_cluster_set_latency_aware_routing(
+                self.0,
+                if enabled { cass_true } else { cass_false },
+            );
         }
         self
     }
 
-
     /// Configures the settings for latency-aware request routing.
     ///
     ///
@@ -460,16 +465,23 @@ impl Cluster {
     ///  <li>min_measured: 50</li>
     /// </ul>
     #[allow(cast_sign_loss)]
-    pub fn set_latency_aware_routing_settings(&mut self, exclusion_threshold: f64, scale: Duration,
-        retry_period: Duration, update_rate: Duration, min_measured: u64)
-                                              -> &Self {
-        unsafe {
-            cass_cluster_set_latency_aware_routing_settings(self.0,
-                                                            exclusion_threshold,
-                                                            scale.num_milliseconds() as u64,
-                                                            retry_period.num_milliseconds() as u64,
-                                                            update_rate.num_milliseconds() as u64,
-                                                            min_measured);
+    pub fn set_latency_aware_routing_settings(
+        &mut self,
+        exclusion_threshold: f64,
+        scale: Duration,
+        retry_period: Duration,
+        update_rate: Duration,
+        min_measured: u64,
+    ) -> &Self {
+        unsafe {
+            cass_cluster_set_latency_aware_routing_settings(
+                self.0,
+                exclusion_threshold,
+                scale.num_milliseconds() as u64,
+                retry_period.num_milliseconds() as u64,
+                update_rate.num_milliseconds() as u64,
+                min_measured,
+            );
         }
         self
     }
@@ -507,12 +519,14 @@ impl Cluster {
     ///
     ///
     /// Default: false (disabled).
-    #[allow(cast_possible_truncation,cast_sign_loss)]
+    #[allow(cast_possible_truncation, cast_sign_loss)]
     pub fn set_tcp_keepalive(&mut self, enable: bool, delay: Duration) -> &Self {
         unsafe {
-            cass_cluster_set_tcp_keepalive(self.0,
-                                           if enable { cass_true } else { cass_false },
-                                           delay.num_seconds() as u32);
+            cass_cluster_set_tcp_keepalive(
+                self.0,
+                if enable { cass_true } else { cass_false },
+                delay.num_seconds() as u32,
+            );
         }
         self
     }
@@ -536,7 +550,7 @@ impl Cluster {
     ///
     ///
     /// Default: 30 seconds
-    #[allow(cast_possible_truncation,cast_sign_loss)]
+    #[allow(cast_possible_truncation, cast_sign_loss)]
     pub fn set_connection_heartbeat_interval(&mut self, hearbeat: Duration) -> &mut Self {
         unsafe {
             cass_cluster_set_connection_heartbeat_interval(self.0, hearbeat.num_seconds() as u32);
@@ -549,7 +563,7 @@ impl Cluster {
     ///
     ///
     /// Default: 60 seconds
-    #[allow(cast_possible_truncation,cast_sign_loss)]
+    #[allow(cast_possible_truncation, cast_sign_loss)]
     pub fn set_connection_idle_timeout(&mut self, timeout: Duration) -> &mut Self {
         unsafe {
             cass_cluster_set_connection_idle_timeout(self.0, timeout.num_seconds() as u32);
diff --git a/src/cassandra/collection.rs b/src/cassandra/collection.rs
index 6da7092..3097ed6 100644
--- a/src/cassandra/collection.rs
+++ b/src/cassandra/collection.rs
@@ -1,38 +1,38 @@
-use cassandra::data_type::ConstDataType;
-use cassandra::data_type::DataType;
-use cassandra::inet::Inet;
-use cassandra::tuple::Tuple;
-use cassandra::user_type::UserType;
-use cassandra::util::Protected;
-use cassandra::uuid::Uuid;
-use cassandra::error::*;
-
-use cassandra_sys::CASS_COLLECTION_TYPE_LIST;
-use cassandra_sys::CASS_COLLECTION_TYPE_MAP;
-use cassandra_sys::CASS_COLLECTION_TYPE_SET;
-use cassandra_sys::CassCollection as _CassCollection;
-use cassandra_sys::cass_collection_append_bool;
-use cassandra_sys::cass_collection_append_bytes;
-use cassandra_sys::cass_collection_append_collection;
-use cassandra_sys::cass_collection_append_decimal;
-use cassandra_sys::cass_collection_append_double;
-use cassandra_sys::cass_collection_append_float;
-use cassandra_sys::cass_collection_append_inet;
-use cassandra_sys::cass_collection_append_int16;
-use cassandra_sys::cass_collection_append_int32;
-use cassandra_sys::cass_collection_append_int64;
-use cassandra_sys::cass_collection_append_int8;
-use cassandra_sys::cass_collection_append_string;
-use cassandra_sys::cass_collection_append_tuple;
-use cassandra_sys::cass_collection_append_uint32;
-use cassandra_sys::cass_collection_append_user_type;
-use cassandra_sys::cass_collection_append_uuid;
-use cassandra_sys::cass_collection_data_type;
-use cassandra_sys::cass_collection_free;
-use cassandra_sys::cass_collection_new;
-use cassandra_sys::cass_collection_new_from_data_type;
-use cassandra_sys::cass_false;
-use cassandra_sys::cass_true;
+use crate::cassandra::data_type::ConstDataType;
+use crate::cassandra::data_type::DataType;
+use crate::cassandra::error::*;
+use crate::cassandra::inet::Inet;
+use crate::cassandra::tuple::Tuple;
+use crate::cassandra::user_type::UserType;
+use crate::cassandra::util::Protected;
+use crate::cassandra::uuid::Uuid;
+
+use crate::cassandra_sys::cass_collection_append_bool;
+use crate::cassandra_sys::cass_collection_append_bytes;
+use crate::cassandra_sys::cass_collection_append_collection;
+use crate::cassandra_sys::cass_collection_append_decimal;
+use crate::cassandra_sys::cass_collection_append_double;
+use crate::cassandra_sys::cass_collection_append_float;
+use crate::cassandra_sys::cass_collection_append_inet;
+use crate::cassandra_sys::cass_collection_append_int16;
+use crate::cassandra_sys::cass_collection_append_int32;
+use crate::cassandra_sys::cass_collection_append_int64;
+use crate::cassandra_sys::cass_collection_append_int8;
+use crate::cassandra_sys::cass_collection_append_string;
+use crate::cassandra_sys::cass_collection_append_tuple;
+use crate::cassandra_sys::cass_collection_append_uint32;
+use crate::cassandra_sys::cass_collection_append_user_type;
+use crate::cassandra_sys::cass_collection_append_uuid;
+use crate::cassandra_sys::cass_collection_data_type;
+use crate::cassandra_sys::cass_collection_free;
+use crate::cassandra_sys::cass_collection_new;
+use crate::cassandra_sys::cass_collection_new_from_data_type;
+use crate::cassandra_sys::cass_false;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::CassCollection as _CassCollection;
+use crate::cassandra_sys::CASS_COLLECTION_TYPE_LIST;
+use crate::cassandra_sys::CASS_COLLECTION_TYPE_MAP;
+use crate::cassandra_sys::CASS_COLLECTION_TYPE_SET;
 
 use std::ffi::CString;
 
@@ -120,38 +120,68 @@ pub struct List(*mut _CassCollection);
 unsafe impl Send for List {}
 
 impl Protected<*mut _CassCollection> for List {
-    fn inner(&self) -> *mut _CassCollection { self.0 }
-    fn build(inner: *mut _CassCollection) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; List(inner) }
+    fn inner(&self) -> *mut _CassCollection {
+        self.0
+    }
+    fn build(inner: *mut _CassCollection) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        List(inner)
+    }
 }
 
 impl Protected<*mut _CassCollection> for Map {
-    fn inner(&self) -> *mut _CassCollection { self.0 }
-    fn build(inner: *mut _CassCollection) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Map(inner) }
+    fn inner(&self) -> *mut _CassCollection {
+        self.0
+    }
+    fn build(inner: *mut _CassCollection) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Map(inner)
+    }
 }
 
 impl Protected<*mut _CassCollection> for Set {
-    fn inner(&self) -> *mut _CassCollection { self.0 }
-    fn build(inner: *mut _CassCollection) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Set(inner) }
+    fn inner(&self) -> *mut _CassCollection {
+        self.0
+    }
+    fn build(inner: *mut _CassCollection) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Set(inner)
+    }
 }
 
-
 impl Drop for List {
-    fn drop(&mut self) { unsafe { cass_collection_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_collection_free(self.0) }
+    }
 }
 
 impl CassCollection for List {
     type Value = _CassCollection;
 
     /// create a new list
-    fn new(item_count: usize) -> Self { unsafe { List::build(cass_collection_new(CASS_COLLECTION_TYPE_LIST, item_count)) } }
+    fn new(item_count: usize) -> Self {
+        unsafe { List::build(cass_collection_new(CASS_COLLECTION_TYPE_LIST, item_count)) }
+    }
 
     fn new_from_data_type(value: DataType, item_count: usize) -> Self {
-        unsafe { List(cass_collection_new_from_data_type(value.inner(), item_count)) }
+        unsafe {
+            List(cass_collection_new_from_data_type(
+                value.inner(),
+                item_count,
+            ))
+        }
     }
 
     /// Gets the data type of a collection.
-    fn data_type(&self) -> ConstDataType { unsafe { ConstDataType::build(cass_collection_data_type(self.inner())) } }
-
+    fn data_type(&self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_collection_data_type(self.inner())) }
+    }
 
     /// Appends a "tinyint" to the collection.
     fn append_int8(&mut self, value: i8) -> Result<&mut Self> {
@@ -259,7 +289,9 @@ pub struct Set(*mut _CassCollection);
 unsafe impl Send for Set {}
 
 impl Drop for Set {
-    fn drop(&mut self) { unsafe { cass_collection_free(self.inner()) } }
+    fn drop(&mut self) {
+        unsafe { cass_collection_free(self.inner()) }
+    }
 }
 
 // impl CassIterator for Set{
@@ -270,14 +302,22 @@ impl CassCollection for Set {
     type Value = _CassCollection;
 
     /// create a new list
-    fn new(item_count: usize) -> Self { unsafe { Set(cass_collection_new(CASS_COLLECTION_TYPE_SET, item_count)) } }
+    fn new(item_count: usize) -> Self {
+        unsafe { Set(cass_collection_new(CASS_COLLECTION_TYPE_SET, item_count)) }
+    }
 
     fn new_from_data_type(value: DataType, item_count: usize) -> Self {
-        unsafe { Set(cass_collection_new_from_data_type(value.inner(), item_count)) }
+        unsafe {
+            Set(cass_collection_new_from_data_type(
+                value.inner(),
+                item_count,
+            ))
+        }
     }
     /// Gets the data type of a collection.
-    fn data_type(&self) -> ConstDataType { unsafe { ConstDataType::build(cass_collection_data_type(self.inner())) } }
-
+    fn data_type(&self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_collection_data_type(self.inner())) }
+    }
 
     /// Appends a "tinyint" to the collection.
     fn append_int8(&mut self, value: i8) -> Result<&mut Self> {
@@ -376,7 +416,6 @@ impl CassCollection for Set {
     }
 }
 
-
 /// A Cassandra Map
 #[derive(Debug)]
 pub struct Map(*mut _CassCollection);
@@ -386,21 +425,31 @@ pub struct Map(*mut _CassCollection);
 unsafe impl Send for Map {}
 
 impl Drop for Map {
-    fn drop(&mut self) { unsafe { cass_collection_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_collection_free(self.0) }
+    }
 }
 
 impl CassCollection for Map {
     type Value = _CassCollection;
     /// create a new list
-    fn new(item_count: usize) -> Self { unsafe { Map(cass_collection_new(CASS_COLLECTION_TYPE_MAP, item_count)) } }
+    fn new(item_count: usize) -> Self {
+        unsafe { Map(cass_collection_new(CASS_COLLECTION_TYPE_MAP, item_count)) }
+    }
 
     fn new_from_data_type(value: DataType, item_count: usize) -> Self {
-        unsafe { Map(cass_collection_new_from_data_type(value.inner(), item_count)) }
+        unsafe {
+            Map(cass_collection_new_from_data_type(
+                value.inner(),
+                item_count,
+            ))
+        }
     }
 
     /// Gets the data type of a collection.
-    fn data_type(&self) -> ConstDataType { unsafe { ConstDataType::build(cass_collection_data_type(self.inner())) } }
-
+    fn data_type(&self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_collection_data_type(self.inner())) }
+    }
 
     /// Appends a "tinyint" to the collection.
     fn append_int8(&mut self, value: i8) -> Result<&mut Self> {
diff --git a/src/cassandra/compression.rs b/src/cassandra/compression.rs
index 70d7432..afcd403 100644
--- a/src/cassandra/compression.rs
+++ b/src/cassandra/compression.rs
@@ -1,5 +1,5 @@
-pub type CassCompression {
+pub enum CassCompression {
     NONE = 0,
     SNAPPY = 1,
-    LZ4 = 2
+    LZ4 = 2,
 }
diff --git a/src/cassandra/consistency.rs b/src/cassandra/consistency.rs
index 51b81a6..fd2e834 100644
--- a/src/cassandra/consistency.rs
+++ b/src/cassandra/consistency.rs
@@ -1,7 +1,7 @@
-use cassandra::util::Protected;
-use cassandra_sys::CassConsistency_;
+use crate::cassandra::util::Protected;
+use crate::cassandra_sys::CassConsistency_;
 
-use cassandra_sys::cass_consistency_string;
+use crate::cassandra_sys::cass_consistency_string;
 
 use std::ffi::CStr;
 
diff --git a/src/cassandra/data_type.rs b/src/cassandra/data_type.rs
index e546259..3b0559e 100644
--- a/src/cassandra/data_type.rs
+++ b/src/cassandra/data_type.rs
@@ -1,34 +1,33 @@
-use cassandra::user_type::UserType;
-use cassandra::util::Protected;
-use cassandra::value::ValueType;
-use cassandra::error::*;
-
-use cassandra_sys::CassDataType as _CassDataType;
-use cassandra_sys::cass_data_sub_type_count;
-use cassandra_sys::cass_data_type_add_sub_type;
-use cassandra_sys::cass_data_type_add_sub_type_by_name;
-use cassandra_sys::cass_data_type_add_sub_value_type;
-use cassandra_sys::cass_data_type_add_sub_value_type_by_name;
-use cassandra_sys::cass_data_type_class_name;
-use cassandra_sys::cass_data_type_free;
-use cassandra_sys::cass_data_type_keyspace;
-use cassandra_sys::cass_data_type_new;
-use cassandra_sys::cass_data_type_new_from_existing;
-use cassandra_sys::cass_data_type_new_tuple;
-use cassandra_sys::cass_data_type_new_udt;
-use cassandra_sys::cass_data_type_set_class_name;
-use cassandra_sys::cass_data_type_set_keyspace;
-use cassandra_sys::cass_data_type_set_type_name;
-use cassandra_sys::cass_data_type_sub_data_type;
-use cassandra_sys::cass_data_type_sub_data_type_by_name;
-use cassandra_sys::cass_data_type_sub_type_name;
-use cassandra_sys::cass_data_type_type;
-use cassandra_sys::cass_data_type_type_name;
-use cassandra_sys::cass_user_type_new_from_data_type;
+use crate::cassandra::error::*;
+use crate::cassandra::user_type::UserType;
+use crate::cassandra::util::Protected;
+use crate::cassandra::value::ValueType;
+
+use crate::cassandra_sys::cass_data_sub_type_count;
+use crate::cassandra_sys::cass_data_type_add_sub_type;
+use crate::cassandra_sys::cass_data_type_add_sub_type_by_name;
+use crate::cassandra_sys::cass_data_type_add_sub_value_type;
+use crate::cassandra_sys::cass_data_type_add_sub_value_type_by_name;
+use crate::cassandra_sys::cass_data_type_class_name;
+use crate::cassandra_sys::cass_data_type_free;
+use crate::cassandra_sys::cass_data_type_keyspace;
+use crate::cassandra_sys::cass_data_type_new;
+use crate::cassandra_sys::cass_data_type_new_from_existing;
+use crate::cassandra_sys::cass_data_type_new_tuple;
+use crate::cassandra_sys::cass_data_type_new_udt;
+use crate::cassandra_sys::cass_data_type_set_class_name;
+use crate::cassandra_sys::cass_data_type_set_keyspace;
+use crate::cassandra_sys::cass_data_type_set_type_name;
+use crate::cassandra_sys::cass_data_type_sub_data_type;
+use crate::cassandra_sys::cass_data_type_sub_data_type_by_name;
+use crate::cassandra_sys::cass_data_type_sub_type_name;
+use crate::cassandra_sys::cass_data_type_type;
+use crate::cassandra_sys::cass_data_type_type_name;
+use crate::cassandra_sys::cass_user_type_new_from_data_type;
+use crate::cassandra_sys::CassDataType as _CassDataType;
 
 use std::ffi::CString;
 
-
 /// Any cassandra datatype
 #[derive(Debug)]
 pub struct DataType(*mut _CassDataType);
@@ -41,50 +40,80 @@ unsafe impl Send for DataType {}
 unsafe impl Send for ConstDataType {}
 
 impl Protected<*mut _CassDataType> for DataType {
-    fn inner(&self) -> *mut _CassDataType { self.0 }
-    fn build(inner: *mut _CassDataType) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; DataType(inner) }
+    fn inner(&self) -> *mut _CassDataType {
+        self.0
+    }
+    fn build(inner: *mut _CassDataType) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        DataType(inner)
+    }
 }
 
 impl Protected<*const _CassDataType> for ConstDataType {
-    fn inner(&self) -> *const _CassDataType { self.0 }
-    fn build(inner: *const _CassDataType) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; ConstDataType(inner) }
+    fn inner(&self) -> *const _CassDataType {
+        self.0
+    }
+    fn build(inner: *const _CassDataType) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        ConstDataType(inner)
+    }
 }
 
 impl Drop for DataType {
     /// Frees a data type instance.
-    fn drop(&mut self) { unsafe { cass_data_type_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_data_type_free(self.0) }
+    }
 }
 
-
-
 impl DataType {
     /// Creates a new data type with value type.
-    pub fn new(value_type: ValueType) -> Self { unsafe { DataType(cass_data_type_new(value_type.inner())) } }
+    pub fn new(value_type: ValueType) -> Self {
+        unsafe { DataType(cass_data_type_new(value_type.inner())) }
+    }
 
     /// Creates a new data type from an existing data type.
     // TODO: can return NULL
-    pub fn new_user_type(&self) -> UserType { unsafe { UserType::build(cass_user_type_new_from_data_type(self.0)) } }
+    pub fn new_user_type(&self) -> UserType {
+        unsafe { UserType::build(cass_user_type_new_from_data_type(self.0)) }
+    }
 
     /// Creates a new data type from an existing data type.
-    pub fn new_from_existing(&self) -> Self { unsafe { DataType(cass_data_type_new_from_existing(self.0)) } }
+    pub fn new_from_existing(&self) -> Self {
+        unsafe { DataType(cass_data_type_new_from_existing(self.0)) }
+    }
 
     /// Creates a new tuple data type.
-    pub fn new_tuple(item_count: usize) -> Self { unsafe { DataType(cass_data_type_new_tuple(item_count)) } }
+    pub fn new_tuple(item_count: usize) -> Self {
+        unsafe { DataType(cass_data_type_new_tuple(item_count)) }
+    }
 
     /// Creates a new UDT (user defined type) data type.
-    pub fn new_udt(field_count: usize) -> DataType { unsafe { DataType(cass_data_type_new_udt(field_count)) } }
+    pub fn new_udt(field_count: usize) -> DataType {
+        unsafe { DataType(cass_data_type_new_udt(field_count)) }
+    }
 
     /// Gets the value type of the specified data type.
-    pub fn get_type(data_type: DataType) -> ValueType { unsafe { ValueType::build(cass_data_type_type(data_type.0)) } }
+    pub fn get_type(data_type: DataType) -> ValueType {
+        unsafe { ValueType::build(cass_data_type_type(data_type.0)) }
+    }
 
     /// Gets the type name of a UDT data type.
     pub fn type_name<S>(data_type: DataType, type_name: S) -> Result<()>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let type_name2 = CString::new(type_name.into())?;
-            let err = cass_data_type_type_name(data_type.0,
-                                               &mut type_name2.as_ptr(),
-                                               &mut (type_name2.as_bytes().len()));
+            let err = cass_data_type_type_name(
+                data_type.0,
+                &mut type_name2.as_ptr(),
+                &mut (type_name2.as_bytes().len()),
+            );
             err.to_result(())
         }
     }
@@ -93,12 +122,12 @@ impl DataType {
     ///
     /// <b>Note:</b> Only valid for UDT data types.
     pub fn set_type_name<S>(data_type: DataType, type_name: S) -> Result<()>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let type_name_cstr = CString::new(type_name.into())?;
-            cass_data_type_set_type_name(data_type.0,
-                                         type_name_cstr.as_ptr())
-                .to_result(())
+            cass_data_type_set_type_name(data_type.0, type_name_cstr.as_ptr()).to_result(())
         }
     }
 
@@ -106,14 +135,17 @@ impl DataType {
     ///
     /// <b>Note:</b> Only valid for UDT data types.
     pub fn keyspace<S>(data_type: DataType, keyspace: S) -> Result<()>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let keyspace2 = CString::new(keyspace.into())?;
-            cass_data_type_keyspace(data_type.0,
-                                    &mut (keyspace2.as_ptr()),
-                                    &mut (keyspace2.as_bytes().len()))
-                .to_result(())
-
+            cass_data_type_keyspace(
+                data_type.0,
+                &mut (keyspace2.as_ptr()),
+                &mut (keyspace2.as_bytes().len()),
+            )
+            .to_result(())
         }
     }
 
@@ -121,13 +153,12 @@ impl DataType {
     ///
     /// <b>Note:</b> Only valid for UDT data types.
     pub fn set_keyspace<S>(data_type: DataType, keyspace: S) -> Result<()>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let keyspace_cstr = CString::new(keyspace.into())?;
-            cass_data_type_set_keyspace(data_type.0,
-                                        keyspace_cstr.as_ptr())
-                .to_result(())
-
+            cass_data_type_set_keyspace(data_type.0, keyspace_cstr.as_ptr()).to_result(())
         }
     }
 
@@ -135,14 +166,17 @@ impl DataType {
     ///
     /// <b>Note:</b> Only valid for custom data types.
     pub fn class_name<S>(data_type: DataType, class_name: S) -> Result<()>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let class_name2 = CString::new(class_name.into())?;
-            cass_data_type_class_name(data_type.0,
-                                      &mut class_name2.as_ptr(),
-                                      &mut (class_name2.as_bytes().len()))
-                .to_result(())
-
+            cass_data_type_class_name(
+                data_type.0,
+                &mut class_name2.as_ptr(),
+                &mut (class_name2.as_bytes().len()),
+            )
+            .to_result(())
         }
     }
 
@@ -150,12 +184,12 @@ impl DataType {
     ///
     /// <b>Note:</b> Only valid for custom data types.
     pub fn set_class_name<S>(&self, class_name: S) -> Result<()>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let class_name_cstr = CString::new(class_name.into())?;
-            cass_data_type_set_class_name(self.0,
-                                          class_name_cstr.as_ptr())
-                .to_result(())
+            cass_data_type_set_class_name(self.0, class_name_cstr.as_ptr()).to_result(())
         }
     }
 
@@ -163,7 +197,9 @@ impl DataType {
     /// or collection.
     ///
     /// <b>Note:</b> Only valid for UDT, tuple and collection data types.
-    pub fn sub_type_count<S>(&self) -> usize { unsafe { cass_data_sub_type_count(self.0) } }
+    pub fn sub_type_count<S>(&self) -> usize {
+        unsafe { cass_data_sub_type_count(self.0) }
+    }
 
     /// Gets the sub-data type of a UDT (user defined type), tuple or collection at
     /// the specified index.
@@ -178,13 +214,16 @@ impl DataType {
     ///
     /// <b>Note:</b> Only valid for UDT data types.
     pub fn sub_data_type_by_name<S>(data_type: DataType, name: S) -> ConstDataType
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name_cstr = CString::new(name.into()).expect("must be utf8");
             // TODO: can return NULL
-            ConstDataType::build(cass_data_type_sub_data_type_by_name(data_type.0,
-                                                               name_cstr
-                                                                   .as_ptr()))
+            ConstDataType::build(cass_data_type_sub_data_type_by_name(
+                data_type.0,
+                name_cstr.as_ptr(),
+            ))
         }
     }
 
@@ -192,16 +231,18 @@ impl DataType {
     ///
     /// <b>Note:</b> Only valid for UDT data types.
     pub fn sub_type_name<S>(data_type: DataType, index: usize, name: S) -> Result<()>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name2 = CString::new(name.into())?;
-            cass_data_type_sub_type_name(data_type.0,
-                                         index,
-                                         &mut name2.as_ptr(),
-                                         &mut (name2.as_bytes().len()))
-                .to_result(())
-
-
+            cass_data_type_sub_type_name(
+                data_type.0,
+                index,
+                &mut name2.as_ptr(),
+                &mut (name2.as_bytes().len()),
+            )
+            .to_result(())
         }
     }
 
@@ -209,25 +250,24 @@ impl DataType {
     ///
     /// <b>Note:</b> Only valid for tuple and collection data types.
     pub fn add_sub_type(&self, sub_data_type: DataType) -> Result<()> {
-        unsafe {
-            cass_data_type_add_sub_type(self.0, sub_data_type.0)
-                .to_result(())
-
-        }
+        unsafe { cass_data_type_add_sub_type(self.0, sub_data_type.0).to_result(()) }
     }
 
     /// Gets the sub-data type of a UDT (user defined type) at the specified index.
     ///
     /// <b>Note:</b> Only valid for UDT data types.
     pub fn add_sub_type_by_name<S>(&mut self, name: S, sub_data_type: DataType) -> Result<()>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let sub_data_type_cstr = CString::new(name.into())?;
-            cass_data_type_add_sub_type_by_name(self.0,
-                                                sub_data_type_cstr.as_ptr(),
-                                                sub_data_type.0)
-                .to_result(())
-
+            cass_data_type_add_sub_type_by_name(
+                self.0,
+                sub_data_type_cstr.as_ptr(),
+                sub_data_type.0,
+            )
+            .to_result(())
         }
     }
 
@@ -235,27 +275,24 @@ impl DataType {
     ///
     /// <b>Note:</b> Only valid for tuple and collection data types.
     pub fn add_sub_value_type<S>(&self, sub_value_type: ValueType) -> Result<()>
-        where S: Into<String> {
-        unsafe {
-            cass_data_type_add_sub_value_type(self.0, sub_value_type.inner())
-                .to_result(())
-
-        }
+    where
+        S: Into<String>,
+    {
+        unsafe { cass_data_type_add_sub_value_type(self.0, sub_value_type.inner()).to_result(()) }
     }
 
     /// Adds a sub-data type to a tuple or collection using a value type.
     ///
     /// <b>Note:</b> Only valid for tuple and collection data types.
     pub fn add_sub_value_type_by_name<S>(&self, name: &str, typ: ValueType) -> Result<()>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_data_type_add_sub_value_type_by_name(self.0,
-                                                      name_cstr.as_ptr(),
-                                                      typ.inner())
+            cass_data_type_add_sub_value_type_by_name(self.0, name_cstr.as_ptr(), typ.inner())
                 .to_result(())
         }
-
     }
 
     //    pub fn set_type_name_n<S>(data_type: DataType, type_name: S) -> Result<(), CassError>
@@ -282,7 +319,6 @@ impl DataType {
     //        }
     //    }
 
-
     //    pub fn sub_data_type_by_name_n<S>(data_type: DataType, name: S) -> ConstDataType
     //        where S: Into<String>
     //    {
diff --git a/src/cassandra/error.rs b/src/cassandra/error.rs
index dd9e499..6cd9cba 100644
--- a/src/cassandra/error.rs
+++ b/src/cassandra/error.rs
@@ -1,30 +1,31 @@
-use cassandra::consistency::Consistency;
-use cassandra::util::Protected;
-use cassandra::write_type::WriteType;
-use cassandra::value::ValueType;
+use crate::cassandra::consistency::Consistency;
+use crate::cassandra::util::Protected;
+use crate::cassandra::value::ValueType;
+use crate::cassandra::write_type::WriteType;
 
-use cassandra_sys::CASS_OK;
-use cassandra_sys::CassError_;
-use cassandra_sys::CassErrorResult as CassErrorResult_;
-use cassandra_sys::CassFuture as _Future;
-use cassandra_sys::cass_error_desc;
-use cassandra_sys::cass_error_result_code;
-use cassandra_sys::cass_error_result_free;
-use cassandra_sys::{cass_true, cass_false};
-use cassandra_sys::{cass_error_result_responses_received, cass_error_result_responses_required,
-                    cass_error_result_num_failures, cass_error_result_data_present,
-                    cass_error_result_write_type, cass_error_result_keyspace,
-                    cass_error_result_table, cass_error_result_function, cass_error_num_arg_types,
-                    cass_error_result_arg_type, cass_error_result_consistency};
-use cassandra_sys::cass_future_error_code;
-use cassandra_sys::cass_future_error_message;
-use cassandra_sys::cass_future_get_error_result;
+use crate::cassandra_sys::cass_error_desc;
+use crate::cassandra_sys::cass_error_result_code;
+use crate::cassandra_sys::cass_error_result_free;
+use crate::cassandra_sys::cass_future_error_code;
+use crate::cassandra_sys::cass_future_error_message;
+use crate::cassandra_sys::cass_future_get_error_result;
+use crate::cassandra_sys::CassErrorResult as CassErrorResult_;
+use crate::cassandra_sys::CassError_;
+use crate::cassandra_sys::CassFuture as _Future;
+use crate::cassandra_sys::CASS_OK;
+use crate::cassandra_sys::{
+    cass_error_num_arg_types, cass_error_result_arg_type, cass_error_result_consistency,
+    cass_error_result_data_present, cass_error_result_function, cass_error_result_keyspace,
+    cass_error_result_num_failures, cass_error_result_responses_received,
+    cass_error_result_responses_required, cass_error_result_table, cass_error_result_write_type,
+};
+use crate::cassandra_sys::{cass_false, cass_true};
 
-use std::{fmt, mem, slice, str};
 use std::error::Error as IError;
 use std::ffi::{CStr, CString};
 use std::fmt::{Debug, Display, Formatter};
 use std::os::raw::c_char;
+use std::{fmt, mem, slice, str};
 
 // Define the errors that may be returned by this driver.
 error_chain! {
@@ -80,32 +81,45 @@ pub(crate) trait CassErrorExt {
 }
 
 impl CassErrorExt for CassError_ {
-    fn to_result<T>(&self, default: T) -> Result<T> { unsafe {
-        match *self {
-            CASS_OK => Ok(default),
-            _ => {
-                let message = CStr::from_ptr(cass_error_desc(*self)).to_string_lossy().into_owned();
-                Err(ErrorKind::CassError(CassErrorCode::build(*self), message).into())
-            },
+    fn to_result<T>(&self, default: T) -> Result<T> {
+        unsafe {
+            match *self {
+                CASS_OK => Ok(default),
+                _ => {
+                    let message = CStr::from_ptr(cass_error_desc(*self))
+                        .to_string_lossy()
+                        .into_owned();
+                    Err(ErrorKind::CassError(CassErrorCode::build(*self), message).into())
+                }
+            }
         }
-    }}
+    }
 
-    fn to_error(&self) -> Error { unsafe {
-        let message = CStr::from_ptr(cass_error_desc(*self)).to_string_lossy().into_owned();
-        ErrorKind::CassError(CassErrorCode::build(*self), message).into()
-    }}
+    fn to_error(&self) -> Error {
+        unsafe {
+            let message = CStr::from_ptr(cass_error_desc(*self))
+                .to_string_lossy()
+                .into_owned();
+            ErrorKind::CassError(CassErrorCode::build(*self), message).into()
+        }
+    }
 }
 
 impl CassErrorExt for CassErrorCode {
-    fn to_result<T>(&self, default: T) -> Result<T> { self.inner().to_result(default) }
-    fn to_error(&self) -> Error { self.inner().to_error() }
+    fn to_result<T>(&self, default: T) -> Result<T> {
+        self.inner().to_result(default)
+    }
+    fn to_error(&self) -> Error {
+        self.inner().to_error()
+    }
 }
 
-
 /// Build an error from the code, message, and optional `CassErrorResult_`.
-pub(crate) unsafe fn build_error_result(code: CassErrorCode,
-                             message: String,
-                             e: *const CassErrorResult_) -> Error {
+pub(crate) unsafe fn build_error_result(
+    code: CassErrorCode,
+    message: String,
+    e: *const CassErrorResult_,
+) -> Error {
     if e.is_null() {
         // No extended error available; just take the basic one.
         ErrorKind::CassError(code, message).into()
@@ -144,8 +158,9 @@ pub(crate) unsafe fn build_error_result(code: CassErrorCode,
             write_type,
             keyspace,
             table,
-            function_call
-        ).into()
+            function_call,
+        )
+        .into()
     }
 }
 
@@ -155,7 +170,8 @@ pub(crate) unsafe fn get_cass_future_error(rc: CassError_, inner: *mut _Future)
     let message = get_lossy_string(|s, s_len| {
         cass_future_error_message(inner, s, s_len);
         CASS_OK
-    }).unwrap(); // always OK so cannot fail
+    })
+    .unwrap(); // always OK so cannot fail
     build_error_result(code, message, cass_future_get_error_result(inner))
 }
 
@@ -289,7 +305,8 @@ enhance_nullary_enum!(CassErrorCode, CassError_, {
 
 /// Extract an optional C string lossily (i.e., using a replacement char for non-UTF-8 sequences).
 pub(crate) unsafe fn get_lossy_string<F>(get: F) -> Option<String>
-    where F: Fn(*mut *const ::std::os::raw::c_char, *mut usize) -> CassError_
+where
+    F: Fn(*mut *const ::std::os::raw::c_char, *mut usize) -> CassError_,
 {
     let mut msg = mem::zeroed();
     let mut msg_len = mem::zeroed();
@@ -307,10 +324,13 @@ mod tests {
 
     #[test]
     pub fn test_conversion() {
-        assert_eq!(CassErrorCode::build(CassError_::CASS_ERROR_SERVER_PROTOCOL_ERROR), CassErrorCode::SERVER_PROTOCOL_ERROR);
+        assert_eq!(
+            CassErrorCode::build(CassError_::CASS_ERROR_SERVER_PROTOCOL_ERROR),
+            CassErrorCode::SERVER_PROTOCOL_ERROR
+        );
         match CassErrorCode::LIB_INVALID_DATA.inner() {
             CassError_::CASS_ERROR_LIB_INVALID_DATA => (),
-            e => panic!("Unexpected return value {:?}", e)
+            e => panic!("Unexpected return value {:?}", e),
         }
     }
 
diff --git a/src/cassandra/field.rs b/src/cassandra/field.rs
index b19bb44..091fa86 100644
--- a/src/cassandra/field.rs
+++ b/src/cassandra/field.rs
@@ -1,57 +1,57 @@
-use cassandra::inet::Inet;
-use cassandra::iterator::MapIterator;
-use cassandra::iterator::SetIterator;
+use crate::cassandra::inet::Inet;
+use crate::cassandra::iterator::MapIterator;
+use crate::cassandra::iterator::SetIterator;
 // use decimal::d128;
-use cassandra::util::Protected;
-use cassandra::uuid::Uuid;
-use cassandra::value::{Value, ValueType, write_set, write_map};
-use cassandra::error::*;
+use crate::cassandra::error::*;
+use crate::cassandra::util::Protected;
+use crate::cassandra::uuid::Uuid;
+use crate::cassandra::value::{write_map, write_set, Value, ValueType};
 
-use cassandra_sys::CASS_ERROR_LIB_INVALID_VALUE_TYPE;
-use cassandra_sys::CASS_VALUE_TYPE_ASCII;
-use cassandra_sys::CASS_VALUE_TYPE_BIGINT;
-use cassandra_sys::CASS_VALUE_TYPE_BLOB;
-use cassandra_sys::CASS_VALUE_TYPE_BOOLEAN;
-use cassandra_sys::CASS_VALUE_TYPE_COUNTER;
-use cassandra_sys::CASS_VALUE_TYPE_CUSTOM;
-use cassandra_sys::CASS_VALUE_TYPE_DATE;
-use cassandra_sys::CASS_VALUE_TYPE_DECIMAL;
-use cassandra_sys::CASS_VALUE_TYPE_DOUBLE;
-use cassandra_sys::CASS_VALUE_TYPE_FLOAT;
-use cassandra_sys::CASS_VALUE_TYPE_INET;
-use cassandra_sys::CASS_VALUE_TYPE_INT;
-use cassandra_sys::CASS_VALUE_TYPE_LAST_ENTRY;
-use cassandra_sys::CASS_VALUE_TYPE_LIST;
-use cassandra_sys::CASS_VALUE_TYPE_MAP;
-use cassandra_sys::CASS_VALUE_TYPE_SET;
-use cassandra_sys::CASS_VALUE_TYPE_SMALL_INT;
-use cassandra_sys::CASS_VALUE_TYPE_TEXT;
-use cassandra_sys::CASS_VALUE_TYPE_TIME;
-use cassandra_sys::CASS_VALUE_TYPE_TIMESTAMP;
-use cassandra_sys::CASS_VALUE_TYPE_TIMEUUID;
-use cassandra_sys::CASS_VALUE_TYPE_TINY_INT;
-use cassandra_sys::CASS_VALUE_TYPE_TUPLE;
-use cassandra_sys::CASS_VALUE_TYPE_UDT;
-use cassandra_sys::CASS_VALUE_TYPE_UNKNOWN;
-use cassandra_sys::CASS_VALUE_TYPE_UUID;
-use cassandra_sys::CASS_VALUE_TYPE_VARCHAR;
-use cassandra_sys::CASS_VALUE_TYPE_VARINT;
-use cassandra_sys::cass_iterator_from_collection;
-use cassandra_sys::cass_iterator_from_map;
-use cassandra_sys::cass_true;
-use cassandra_sys::cass_value_get_bool;
-use cassandra_sys::cass_value_get_decimal;
-use cassandra_sys::cass_value_get_double;
-use cassandra_sys::cass_value_get_float;
-use cassandra_sys::cass_value_get_inet;
-use cassandra_sys::cass_value_get_int16;
-use cassandra_sys::cass_value_get_int32;
-use cassandra_sys::cass_value_get_int64;
-use cassandra_sys::cass_value_get_int8;
-use cassandra_sys::cass_value_get_string;
-use cassandra_sys::cass_value_get_uint32;
-use cassandra_sys::cass_value_get_uuid;
-use cassandra_sys::cass_value_type;
+use crate::cassandra_sys::cass_iterator_from_collection;
+use crate::cassandra_sys::cass_iterator_from_map;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::cass_value_get_bool;
+use crate::cassandra_sys::cass_value_get_decimal;
+use crate::cassandra_sys::cass_value_get_double;
+use crate::cassandra_sys::cass_value_get_float;
+use crate::cassandra_sys::cass_value_get_inet;
+use crate::cassandra_sys::cass_value_get_int16;
+use crate::cassandra_sys::cass_value_get_int32;
+use crate::cassandra_sys::cass_value_get_int64;
+use crate::cassandra_sys::cass_value_get_int8;
+use crate::cassandra_sys::cass_value_get_string;
+use crate::cassandra_sys::cass_value_get_uint32;
+use crate::cassandra_sys::cass_value_get_uuid;
+use crate::cassandra_sys::cass_value_type;
+use crate::cassandra_sys::CASS_ERROR_LIB_INVALID_VALUE_TYPE;
+use crate::cassandra_sys::CASS_VALUE_TYPE_ASCII;
+use crate::cassandra_sys::CASS_VALUE_TYPE_BIGINT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_BLOB;
+use crate::cassandra_sys::CASS_VALUE_TYPE_BOOLEAN;
+use crate::cassandra_sys::CASS_VALUE_TYPE_COUNTER;
+use crate::cassandra_sys::CASS_VALUE_TYPE_CUSTOM;
+use crate::cassandra_sys::CASS_VALUE_TYPE_DATE;
+use crate::cassandra_sys::CASS_VALUE_TYPE_DECIMAL;
+use crate::cassandra_sys::CASS_VALUE_TYPE_DOUBLE;
+use crate::cassandra_sys::CASS_VALUE_TYPE_FLOAT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_INET;
+use crate::cassandra_sys::CASS_VALUE_TYPE_INT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_LAST_ENTRY;
+use crate::cassandra_sys::CASS_VALUE_TYPE_LIST;
+use crate::cassandra_sys::CASS_VALUE_TYPE_MAP;
+use crate::cassandra_sys::CASS_VALUE_TYPE_SET;
+use crate::cassandra_sys::CASS_VALUE_TYPE_SMALL_INT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TEXT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TIME;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TIMESTAMP;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TIMEUUID;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TINY_INT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TUPLE;
+use crate::cassandra_sys::CASS_VALUE_TYPE_UDT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_UNKNOWN;
+use crate::cassandra_sys::CASS_VALUE_TYPE_UUID;
+use crate::cassandra_sys::CASS_VALUE_TYPE_VARCHAR;
+use crate::cassandra_sys::CASS_VALUE_TYPE_VARINT;
 
 use std::fmt;
 use std::fmt::Debug;
@@ -61,7 +61,6 @@ use std::mem;
 use std::slice;
 use std::str;
 
-
 // #[repr(C)]
 // #[derive(Copy,Debug,Clone)]
 // #[allow(missing_docs)]
@@ -110,11 +109,17 @@ impl Display for Field {
 
 impl Field {
     /// Gets the name of this field
-    pub fn get_name(&self) -> String { self.name.clone() }
+    pub fn get_name(&self) -> String {
+        self.name.clone()
+    }
 
     /// Gets the type of this field
-    pub fn get_type(&self) -> ValueType { self.value.get_type() }
+    pub fn get_type(&self) -> ValueType {
+        self.value.get_type()
+    }
 
     /// Gets the value of this field
-    pub fn get_value(&self) -> &Value { &self.value }
+    pub fn get_value(&self) -> &Value {
+        &self.value
+    }
 }
diff --git a/src/cassandra/future.rs b/src/cassandra/future.rs
index 785e97e..6922071 100644
--- a/src/cassandra/future.rs
+++ b/src/cassandra/future.rs
@@ -1,28 +1,30 @@
-use cassandra::error::*;
-use cassandra::prepared::PreparedStatement;
-use cassandra::result::CassResult;
-use cassandra::util::Protected;
-use cassandra::consistency::Consistency;
-use cassandra::write_type::WriteType;
-use cassandra_sys::CassError_;
-use cassandra_sys::CASS_OK;
-use cassandra_sys::CassFuture as _Future;
-use cassandra_sys::cass_future_error_code;
-use cassandra_sys::cass_future_error_message;
-use cassandra_sys::cass_future_free;
-use cassandra_sys::cass_future_get_error_result;
-use cassandra_sys::cass_future_get_prepared;
-use cassandra_sys::cass_future_get_result;
-use cassandra_sys::cass_future_ready;
-use cassandra_sys::cass_future_set_callback;
-use cassandra_sys::{cass_true, cass_false};
+use crate::cassandra::consistency::Consistency;
+use crate::cassandra::error::*;
+use crate::cassandra::prepared::PreparedStatement;
+use crate::cassandra::result::CassResult;
+use crate::cassandra::util::Protected;
+use crate::cassandra::write_type::WriteType;
+use crate::cassandra_sys::cass_future_error_code;
+use crate::cassandra_sys::cass_future_error_message;
+use crate::cassandra_sys::cass_future_free;
+use crate::cassandra_sys::cass_future_get_error_result;
+use crate::cassandra_sys::cass_future_get_prepared;
+use crate::cassandra_sys::cass_future_get_result;
+use crate::cassandra_sys::cass_future_ready;
+use crate::cassandra_sys::cass_future_set_callback;
+use crate::cassandra_sys::CassError_;
+use crate::cassandra_sys::CassFuture as _Future;
+use crate::cassandra_sys::CASS_OK;
+use crate::cassandra_sys::{cass_false, cass_true};
 
+use std::future::Future;
+use std::marker::PhantomData;
 use std::mem;
+use std::pin::Pin;
 use std::slice;
 use std::str;
 use std::sync::{Arc, Mutex};
-use std::marker::PhantomData;
-use futures;
+use std::task::{Context, Poll, Waker};
 
 /// A future representing the result of a Cassandra driver operation.
 ///
@@ -64,7 +66,9 @@ impl<T> CassFuture<T> {
     pub(crate) fn build(inner: *mut _Future) -> Self {
         CassFuture {
             inner,
-            state: Arc::new(FutureTarget { inner: Mutex::new(FutureState::Created) }),
+            state: Arc::new(FutureTarget {
+                inner: Mutex::new(FutureState::Created),
+            }),
             phantom: PhantomData,
         }
     }
@@ -76,13 +80,18 @@ impl<T> Drop for CassFuture<T> {
     /// This also drops its reference to the FutureTarget, but if
     /// we're waiting to be called back the FutureState::Awaiting holds another reference to
     /// the target, which keeps it alive until the callback fires.
-    fn drop(&mut self) { unsafe { cass_future_free(self.inner) }; }
+    fn drop(&mut self) {
+        unsafe { cass_future_free(self.inner) };
+    }
 }
 
 /// A type is Completable if it can be returned from a Cassandra driver future.
 /// You should only use this if you reasonably expect that a particular future will
 /// have such a result; for `CassFuture`s we ensure this by construction.
-pub trait Completable where Self: Sized {
+pub trait Completable
+where
+    Self: Sized,
+{
     /// Extract the result from the future, if present.
     unsafe fn get(inner: *mut _Future) -> Option<Self>;
 }
@@ -97,23 +106,26 @@ impl Completable for () {
 /// The mainline case - a CassResult.
 impl Completable for CassResult {
     unsafe fn get(inner: *mut _Future) -> Option<Self> {
-        cass_future_get_result(inner).as_ref().map(|r| CassResult::build(r as *const _))
+        cass_future_get_result(inner)
+            .as_ref()
+            .map(|r| CassResult::build(r as *const _))
     }
 }
 
 /// Futures that complete with a prepared statement.
 impl Completable for PreparedStatement {
     unsafe fn get(inner: *mut _Future) -> Option<Self> {
-        cass_future_get_prepared(inner).as_ref().map(|r| PreparedStatement::build(r as *const _))
+        cass_future_get_prepared(inner)
+            .as_ref()
+            .map(|r| PreparedStatement::build(r as *const _))
     }
 }
 
 /// A Cassandra future is a normal Rust future.
-impl<T: Completable> futures::Future for CassFuture<T> {
-    type Item = T;
-    type Error = Error;
+impl<T: Completable> Future for CassFuture<T> {
+    type Output = Result<T>;
 
-    fn poll(&mut self) -> futures::Poll<Self::Item, Self::Error> { unsafe {
+    fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
         let mut install_callback = false;
         let ret = {
             // Perform the following computations under the lock, and then release it.
@@ -134,57 +146,70 @@ impl<T: Completable> futures::Future for CassFuture<T> {
                 ref mut state @ FutureState::Created => {
                     // No task yet - schedule a callback. But as an optimization, if it's ready
                     // already, complete now without scheduling a callback.
-                    if cass_future_ready(self.inner) == cass_true {
+                    if unsafe { cass_future_ready(self.inner) } == cass_true {
                         // Future is ready; wrap success in `Ok(Ready)` or report failure as `Err`.
-                        get_completion(self.inner).map(futures::Async::Ready)
+                        Poll::Ready(unsafe { get_completion(self.inner) })
                     } else {
                         // Future is not ready; park this task and arrange to be called back when
                         // it is.
                         *state = FutureState::Awaiting {
-                            task: futures::task::current(),
+                            waker: cx.waker().clone(),
                             keep_alive: self.state.clone(),
                         };
                         install_callback = true;
-                        Ok(futures::Async::NotReady)
+                        Poll::Pending
                     }
-                },
-                FutureState::Awaiting { ref mut task, .. } => {
+                }
+                FutureState::Awaiting { ref mut waker, .. } => {
                     // Callback already scheduled; don't set it again (C doesn't support it anyway),
                     // but be sure to swizzle the new task into place. No need to check for
                     // readiness here; we have to wait for the callback anyway so we might as well
                     // do all the work in one place.
-                    *task = futures::task::current();
-                    Ok(futures::Async::NotReady)
-                },
+                    if !waker.will_wake(cx.waker()) {
+                        *waker = cx.waker().clone();
+                    }
+                    Poll::Pending
+                }
                 FutureState::Ready => {
                     // Future has been marked ready by callback. Safe to return now.
-                    get_completion(self.inner).map(futures::Async::Ready)
+                    Poll::Ready(unsafe { get_completion(self.inner) })
                 }
             }
         };
 
         if install_callback {
             // Install the callback. If callback cannot be sent, report immediate `Err`.
-            let data =
-                (self.state.as_ref() as *const FutureTarget) as *mut ::std::os::raw::c_void;
-            cass_future_set_callback(self.inner, Some(notify_task), data)
-                .to_result(())
-        } else {
-            Ok(())
-        }.and_then(move |_| ret)
-    }}
+            let data = (self.state.as_ref() as *const FutureTarget) as *mut ::std::os::raw::c_void;
+            unsafe { cass_future_set_callback(self.inner, Some(notify_task), data) }
+                .to_result(())?;
+        }
+
+        ret
+    }
 }
 
-/// Extract success or failure from a completed future.
+impl<T: Completable> CassFuture<T> {
+    /// Synchronously executes the CassFuture, blocking until it
+    /// completes.
+    pub fn wait(self) -> Result<T> {
+        unsafe { get_completion(self.inner) }
+    }
+}
+
+/// Extract success or failure from a future.
+///
+/// This function will block if the future is not yet ready. In order to ensure that this
+/// function will not block, you can check if the future is ready prior to calling this using
+/// `cass_future_ready`. If the future is ready, this function will not block, otherwise
+/// it will block on waiting for the future to become ready.
 unsafe fn get_completion<T: Completable>(inner: *mut _Future) -> Result<T> {
-    // Future is ready; wrap success in `Ok(Ready)` or report failure as `Err`.
+    // Wrap success in `Ok(Ready)` or report failure as `Err`.
+    // This will block if the future is not yet ready.
     let rc = cass_future_error_code(inner);
     match rc {
-        CASS_OK => {
-            match Completable::get(inner) {
-                None => Err(CassErrorCode::LIB_NULL_VALUE.to_error()),
-                Some(v) => Ok(v)
-            }
+        CASS_OK => match Completable::get(inner) {
+            None => Err(CassErrorCode::LIB_NULL_VALUE.to_error()),
+            Some(v) => Ok(v),
         },
         _ => Err(get_cass_future_error(rc, inner)),
     }
@@ -226,7 +251,10 @@ enum FutureState {
     /// `keep_alive` is an Arc to the enclosing target (i.e., a cycle) which stands for the
     /// pointer held by the C++ Cassandra driver future as the callback target. This prevents
     /// it from being freed early.
-    Awaiting { task: futures::task::Task, keep_alive: Arc<FutureTarget> },
+    Awaiting {
+        waker: Waker,
+        keep_alive: Arc<FutureTarget>,
+    },
 
     /// The future has called back to indicate completion.
     Ready,
@@ -242,8 +270,8 @@ unsafe extern "C" fn notify_task(_c_future: *mut _Future, data: *mut ::std::os::
         let mut lock = future_target.inner.lock().expect("notify_task");
         mem::replace(&mut *lock, FutureState::Ready)
     };
-    if let FutureState::Awaiting { ref task, .. } = state {
-        task.notify();
+    if let FutureState::Awaiting { ref waker, .. } = state {
+        waker.wake_by_ref();
     } else {
         // This can never happen.
         panic!("Callback invoked before callback set");
diff --git a/src/cassandra/inet.rs b/src/cassandra/inet.rs
index d9c536b..5cfd1c7 100644
--- a/src/cassandra/inet.rs
+++ b/src/cassandra/inet.rs
@@ -1,10 +1,10 @@
-use cassandra::util::Protected;
-use cassandra::error::*;
-use cassandra_sys::CassInet as _Inet;
-use cassandra_sys::cass_inet_from_string;
-use cassandra_sys::cass_inet_init_v4;
-use cassandra_sys::cass_inet_init_v6;
-use cassandra_sys::cass_inet_string;
+use crate::cassandra::error::*;
+use crate::cassandra::util::Protected;
+use crate::cassandra_sys::cass_inet_from_string;
+use crate::cassandra_sys::cass_inet_init_v4;
+use crate::cassandra_sys::cass_inet_init_v6;
+use crate::cassandra_sys::cass_inet_string;
+use crate::cassandra_sys::CassInet as _Inet;
 use std::default::Default;
 use std::ffi::CStr;
 use std::ffi::CString;
@@ -17,11 +17,13 @@ use std::string::ToString;
 
 #[repr(C)]
 /// Cassandra's version of an IP address
-#[derive(Copy,Clone)]
+#[derive(Copy, Clone)]
 pub struct Inet(_Inet);
 
 impl Debug for Inet {
-    fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!(f, "{}", self.to_string()) }
+    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+        write!(f, "{}", self.to_string())
+    }
 }
 
 impl PartialEq for Inet {
@@ -35,12 +37,18 @@ impl PartialEq for Inet {
 }
 
 impl Protected<_Inet> for Inet {
-    fn inner(&self) -> _Inet { self.0 }
-    fn build(inner: _Inet) -> Self { Inet(inner) }
+    fn inner(&self) -> _Inet {
+        self.0
+    }
+    fn build(inner: _Inet) -> Self {
+        Inet(inner)
+    }
 }
 
 impl Default for Inet {
-    fn default() -> Inet { unsafe { ::std::mem::zeroed() } }
+    fn default() -> Inet {
+        unsafe { ::std::mem::zeroed() }
+    }
 }
 
 impl Inet {
@@ -80,7 +88,8 @@ impl FromStr for Inet {
             let mut inet = mem::zeroed();
 
             let str = CString::new(s)?;
-            cass_inet_from_string(str.as_ptr(), &mut inet).to_result(())
+            cass_inet_from_string(str.as_ptr(), &mut inet)
+                .to_result(())
                 .and_then(|_| Ok(Inet(inet)))
         }
     }
@@ -103,7 +112,7 @@ impl<'a> From<&'a Inet> for IpAddr {
                 let mut octets = [0u8; 4];
                 octets.copy_from_slice(&inet.0.address[0..4]);
                 IpAddr::from(octets)
-            },
+            }
             16 => IpAddr::from(inet.0.address),
             unsupported => panic!("impossible inet type: {}", unsupported),
         }
@@ -112,16 +121,16 @@ impl<'a> From<&'a Inet> for IpAddr {
 
 #[test]
 fn ipv4_conversion() {
-     let ipv4_in = Ipv4Addr::new(127, 0, 0, 1);
-     let inet = Inet::cass_inet_init_v4(&ipv4_in);
-     let ip_out = IpAddr::from(&inet);
-     assert_eq!(IpAddr::V4(ipv4_in), ip_out);
+    let ipv4_in = Ipv4Addr::new(127, 0, 0, 1);
+    let inet = Inet::cass_inet_init_v4(&ipv4_in);
+    let ip_out = IpAddr::from(&inet);
+    assert_eq!(IpAddr::V4(ipv4_in), ip_out);
 }
 
 #[test]
 fn ipv6_conversion() {
-     let ipv6_in = Ipv6Addr::new(0x2001, 0x0db8, 0, 0, 0, 0, 0, 1);
-     let inet = Inet::cass_inet_init_v6(&ipv6_in);
-     let ip_out = IpAddr::from(&inet);
-     assert_eq!(IpAddr::V6(ipv6_in), ip_out);
+    let ipv6_in = Ipv6Addr::new(0x2001, 0x0db8, 0, 0, 0, 0, 0, 1);
+    let inet = Inet::cass_inet_init_v6(&ipv6_in);
+    let ip_out = IpAddr::from(&inet);
+    assert_eq!(IpAddr::V6(ipv6_in), ip_out);
 }
diff --git a/src/cassandra/iterator.rs b/src/cassandra/iterator.rs
index 1e10644..1b6023f 100644
--- a/src/cassandra/iterator.rs
+++ b/src/cassandra/iterator.rs
@@ -1,33 +1,33 @@
-use cassandra::data_type::DataType;
-use cassandra::field::Field;
-use cassandra::schema::aggregate_meta::AggregateMeta;
-use cassandra::schema::column_meta::ColumnMeta;
-use cassandra::schema::function_meta::FunctionMeta;
-use cassandra::schema::keyspace_meta::KeyspaceMeta;
-use cassandra::schema::table_meta::TableMeta;
-use cassandra::util::Protected;
-use cassandra::value::Value;
-use cassandra::error::*;
+use crate::cassandra::data_type::DataType;
+use crate::cassandra::error::*;
+use crate::cassandra::field::Field;
+use crate::cassandra::schema::aggregate_meta::AggregateMeta;
+use crate::cassandra::schema::column_meta::ColumnMeta;
+use crate::cassandra::schema::function_meta::FunctionMeta;
+use crate::cassandra::schema::keyspace_meta::KeyspaceMeta;
+use crate::cassandra::schema::table_meta::TableMeta;
+use crate::cassandra::util::Protected;
+use crate::cassandra::value::Value;
 
 // use cassandra_sys::CassIteratorType as _CassIteratorType;
-use cassandra_sys::CassIterator as _CassIterator;
-use cassandra_sys::cass_false;
+use crate::cassandra_sys::cass_false;
+use crate::cassandra_sys::CassIterator as _CassIterator;
 // use cassandra_sys::cass_iterator_type;
-use cassandra_sys::cass_iterator_free;
-use cassandra_sys::cass_iterator_get_aggregate_meta;
-use cassandra_sys::cass_iterator_get_column_meta;
-use cassandra_sys::cass_iterator_get_function_meta;
-use cassandra_sys::cass_iterator_get_keyspace_meta;
-use cassandra_sys::cass_iterator_get_map_key;
-use cassandra_sys::cass_iterator_get_map_value;
-use cassandra_sys::cass_iterator_get_meta_field_name;
-use cassandra_sys::cass_iterator_get_meta_field_value;
-use cassandra_sys::cass_iterator_get_table_meta;
-use cassandra_sys::cass_iterator_get_user_type_field_name;
-use cassandra_sys::cass_iterator_get_user_type_field_value;
-use cassandra_sys::cass_iterator_get_value;
-use cassandra_sys::cass_iterator_next;
-use cassandra_sys::cass_true;
+use crate::cassandra_sys::cass_iterator_free;
+use crate::cassandra_sys::cass_iterator_get_aggregate_meta;
+use crate::cassandra_sys::cass_iterator_get_column_meta;
+use crate::cassandra_sys::cass_iterator_get_function_meta;
+use crate::cassandra_sys::cass_iterator_get_keyspace_meta;
+use crate::cassandra_sys::cass_iterator_get_map_key;
+use crate::cassandra_sys::cass_iterator_get_map_value;
+use crate::cassandra_sys::cass_iterator_get_meta_field_name;
+use crate::cassandra_sys::cass_iterator_get_meta_field_value;
+use crate::cassandra_sys::cass_iterator_get_table_meta;
+use crate::cassandra_sys::cass_iterator_get_user_type_field_name;
+use crate::cassandra_sys::cass_iterator_get_user_type_field_value;
+use crate::cassandra_sys::cass_iterator_get_value;
+use crate::cassandra_sys::cass_iterator_next;
+use crate::cassandra_sys::cass_true;
 use std::{mem, slice, str};
 
 /// Iterates over the  aggregate metadata entries(??)
@@ -39,7 +39,9 @@ pub struct AggregateIterator(*mut _CassIterator);
 unsafe impl Send for AggregateIterator {}
 
 impl Drop for AggregateIterator {
-    fn drop(&mut self) { unsafe { cass_iterator_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_iterator_free(self.0) }
+    }
 }
 
 impl Iterator for AggregateIterator {
@@ -66,7 +68,9 @@ pub struct UserTypeIterator(*mut _CassIterator);
 unsafe impl Send for UserTypeIterator {}
 
 impl Drop for UserTypeIterator {
-    fn drop(&mut self) { unsafe { cass_iterator_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_iterator_free(self.0) }
+    }
 }
 
 impl Iterator for UserTypeIterator {
@@ -82,22 +86,25 @@ impl Iterator for UserTypeIterator {
 }
 
 impl UserTypeIterator {
-    fn get_field_name(&mut self)-> String {
+    fn get_field_name(&mut self) -> String {
         unsafe {
             let mut name = mem::zeroed();
             let mut name_length = mem::zeroed();
-            cass_iterator_get_user_type_field_name(self.0, &mut name, &mut name_length).to_result(())
+            cass_iterator_get_user_type_field_name(self.0, &mut name, &mut name_length)
+                .to_result(())
                 .and_then(|_| {
                     let slice = slice::from_raw_parts(name as *const u8, name_length as usize);
                     let name = str::from_utf8(slice)?.to_owned();
                     Ok(name)
-                }).expect("Cassandra error during iteration")
+                })
+                .expect("Cassandra error during iteration")
         }
     }
-    fn get_field_value(&mut self)-> Value { unsafe { Value::build(cass_iterator_get_user_type_field_value(self.0)) } }
+    fn get_field_value(&mut self) -> Value {
+        unsafe { Value::build(cass_iterator_get_user_type_field_value(self.0)) }
+    }
 }
 
-
 /// Iterater over the  function metadata entries(??)
 #[derive(Debug)]
 pub struct FunctionIterator(*mut _CassIterator);
@@ -118,7 +125,6 @@ impl Iterator for FunctionIterator {
     }
 }
 
-
 /// Iterater over the table's metadata entries(??)
 #[derive(Debug)]
 pub struct TableIterator(*mut _CassIterator);
@@ -197,21 +203,22 @@ impl Iterator for FieldIterator {
                 cass_true => {
                     let mut name = mem::zeroed();
                     let mut name_length = mem::zeroed();
-                    cass_iterator_get_meta_field_name(self.0, &mut name, &mut name_length).to_result(())
+                    cass_iterator_get_meta_field_name(self.0, &mut name, &mut name_length)
+                        .to_result(())
                         .and_then(|_| {
-                            let slice = slice::from_raw_parts(name as *const u8, name_length as usize);
+                            let slice =
+                                slice::from_raw_parts(name as *const u8, name_length as usize);
                             let name = str::from_utf8(slice)?.to_owned();
                             let value = Value::build(cass_iterator_get_meta_field_value(self.0));
                             Ok(Some(Field { name, value }))
-                        }
-                    )
-                }.expect("Cassandra error during iteration")
+                        })
+                }
+                .expect("Cassandra error during iteration"),
             }
         }
     }
 }
 
-
 // pub struct CassIteratorType(_CassIteratorType);
 
 // impl CassIteratorType {
@@ -228,51 +235,113 @@ impl Iterator for FieldIterator {
 // }
 
 impl Protected<*mut _CassIterator> for UserTypeIterator {
-    fn inner(&self) -> *mut _CassIterator { self.0 }
-    fn build(inner: *mut _CassIterator) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; UserTypeIterator(inner) }
+    fn inner(&self) -> *mut _CassIterator {
+        self.0
+    }
+    fn build(inner: *mut _CassIterator) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        UserTypeIterator(inner)
+    }
 }
 
 impl Protected<*mut _CassIterator> for AggregateIterator {
-    fn inner(&self) -> *mut _CassIterator { self.0 }
-    fn build(inner: *mut _CassIterator) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; AggregateIterator(inner) }
+    fn inner(&self) -> *mut _CassIterator {
+        self.0
+    }
+    fn build(inner: *mut _CassIterator) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        AggregateIterator(inner)
+    }
 }
 
 impl Protected<*mut _CassIterator> for FunctionIterator {
-    fn inner(&self) -> *mut _CassIterator { self.0 }
-    fn build(inner: *mut _CassIterator) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; FunctionIterator(inner) }
+    fn inner(&self) -> *mut _CassIterator {
+        self.0
+    }
+    fn build(inner: *mut _CassIterator) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        FunctionIterator(inner)
+    }
 }
 
 impl Protected<*mut _CassIterator> for KeyspaceIterator {
-    fn inner(&self) -> *mut _CassIterator { self.0 }
-    fn build(inner: *mut _CassIterator) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; KeyspaceIterator(inner) }
+    fn inner(&self) -> *mut _CassIterator {
+        self.0
+    }
+    fn build(inner: *mut _CassIterator) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        KeyspaceIterator(inner)
+    }
 }
 
 impl Protected<*mut _CassIterator> for FieldIterator {
-    fn inner(&self) -> *mut _CassIterator { self.0 }
-    fn build(inner: *mut _CassIterator) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; FieldIterator(inner) }
+    fn inner(&self) -> *mut _CassIterator {
+        self.0
+    }
+    fn build(inner: *mut _CassIterator) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        FieldIterator(inner)
+    }
 }
 
 impl Protected<*mut _CassIterator> for ColumnIterator {
-    fn inner(&self) -> *mut _CassIterator { self.0 }
-    fn build(inner: *mut _CassIterator) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; ColumnIterator(inner) }
+    fn inner(&self) -> *mut _CassIterator {
+        self.0
+    }
+    fn build(inner: *mut _CassIterator) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        ColumnIterator(inner)
+    }
 }
 
 impl Protected<*mut _CassIterator> for TableIterator {
-    fn inner(&self) -> *mut _CassIterator { self.0 }
-    fn build(inner: *mut _CassIterator) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; TableIterator(inner) }
+    fn inner(&self) -> *mut _CassIterator {
+        self.0
+    }
+    fn build(inner: *mut _CassIterator) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        TableIterator(inner)
+    }
 }
 
 impl Protected<*mut _CassIterator> for MapIterator {
-    fn inner(&self) -> *mut _CassIterator { self.0 }
-    fn build(inner: *mut _CassIterator) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; MapIterator(inner) }
+    fn inner(&self) -> *mut _CassIterator {
+        self.0
+    }
+    fn build(inner: *mut _CassIterator) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        MapIterator(inner)
+    }
 }
 
 impl Protected<*mut _CassIterator> for SetIterator {
-    fn inner(&self) -> *mut _CassIterator { self.0 }
-    fn build(inner: *mut _CassIterator) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; SetIterator(inner) }
+    fn inner(&self) -> *mut _CassIterator {
+        self.0
+    }
+    fn build(inner: *mut _CassIterator) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        SetIterator(inner)
+    }
 }
 
-
 /// Iterater over the set's metadata entries(??)
 #[derive(Debug)]
 pub struct SetIterator(*mut _CassIterator);
@@ -291,10 +360,11 @@ unsafe impl Send for SetIterator {}
 // }
 
 impl Drop for SetIterator {
-    fn drop(&mut self) { unsafe { cass_iterator_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_iterator_free(self.0) }
+    }
 }
 
-
 impl Iterator for SetIterator {
     type Item = Value;
 
@@ -309,7 +379,9 @@ impl Iterator for SetIterator {
 }
 
 impl SetIterator {
-    fn get_value(&mut self) -> Value { unsafe { Value::build(cass_iterator_get_value(self.0)) } }
+    fn get_value(&mut self) -> Value {
+        unsafe { Value::build(cass_iterator_get_value(self.0)) }
+    }
 }
 
 /// An iterator over the k/v pair in the map
@@ -321,11 +393,17 @@ pub struct MapIterator(*mut _CassIterator);
 unsafe impl Send for MapIterator {}
 
 impl MapIterator {
-    fn get_key(&mut self) -> Value { unsafe { Value::build(cass_iterator_get_map_key(self.0)) } }
-    fn get_value(&mut self) -> Value { unsafe { Value::build(cass_iterator_get_map_value(self.0)) } }
+    fn get_key(&mut self) -> Value {
+        unsafe { Value::build(cass_iterator_get_map_key(self.0)) }
+    }
+    fn get_value(&mut self) -> Value {
+        unsafe { Value::build(cass_iterator_get_map_value(self.0)) }
+    }
 
     /// Gets the next k/v pair in the map
-    pub fn get_pair(&mut self) -> (Value, Value) { (self.get_key(), self.get_value()) }
+    pub fn get_pair(&mut self) -> (Value, Value) {
+        (self.get_key(), self.get_value())
+    }
 }
 
 /// An iterator over the elements of a Cassandra tuple
@@ -337,7 +415,9 @@ pub struct TupleIterator(pub *mut _CassIterator);
 unsafe impl Send for TupleIterator {}
 
 impl Drop for TupleIterator {
-    fn drop(&mut self) { unsafe { cass_iterator_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_iterator_free(self.0) }
+    }
 }
 
 impl Iterator for TupleIterator {
@@ -353,13 +433,15 @@ impl Iterator for TupleIterator {
 }
 
 impl TupleIterator {
-    fn get_value(&mut self) -> Value { unsafe { Value::build(cass_iterator_get_value(self.0)) } }
+    fn get_value(&mut self) -> Value {
+        unsafe { Value::build(cass_iterator_get_value(self.0)) }
+    }
 }
 
-
-
 impl Drop for MapIterator {
-    fn drop(&mut self) { unsafe { cass_iterator_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_iterator_free(self.0) }
+    }
 }
 
 impl Iterator for MapIterator {
@@ -373,4 +455,3 @@ impl Iterator for MapIterator {
         }
     }
 }
-
diff --git a/src/cassandra/log.rs b/src/cassandra/log.rs
index ad7c413..7d90cc9 100644
--- a/src/cassandra/log.rs
+++ b/src/cassandra/log.rs
@@ -1,18 +1,18 @@
-use cassandra_sys::CassLogLevel_;
-use cassandra_sys::CassLogMessage;
+use crate::cassandra_sys::CassLogLevel_;
+use crate::cassandra_sys::CassLogMessage;
 // use cassandra_sys::cass_log_cleanup; @deprecated
-use cassandra_sys::CassLogCallback;
-use cassandra_sys::cass_log_set_callback;
-use cassandra_sys::cass_log_set_level;
-use cassandra::util::Protected;
+use crate::cassandra::util::Protected;
+use crate::cassandra_sys::cass_log_set_callback;
+use crate::cassandra_sys::cass_log_set_level;
+use crate::cassandra_sys::CassLogCallback;
 // use cassandra_sys::cass_log_set_queue_size; @deprecated
 
+use slog;
+use std::borrow::Borrow;
+use std::boxed::Box;
 use std::ffi::CStr;
 use std::os::raw;
 use std::ptr;
-use std::boxed::Box;
-use std::borrow::Borrow;
-use slog;
 
 /// The possible logging levels that can be set.
 #[derive(Debug, Eq, PartialEq, PartialOrd, Ord, Copy, Clone, Hash)]
@@ -45,7 +45,9 @@ enhance_nullary_enum!(LogLevel, CassLogLevel_, {
 /// <b>Note:</b> This needs to be done before any call that might log, such as
 /// any of the cass_cluster_*() or cass_ssl_*() functions.
 /// <b>Default:</b> WARN
-pub fn set_level(level: LogLevel) { unsafe { cass_log_set_level(level.inner()) } }
+pub fn set_level(level: LogLevel) {
+    unsafe { cass_log_set_level(level.inner()) }
+}
 
 /// Called by Cassandra for every log if logging is enabled. Passes the log to the configured
 /// slog logger.
@@ -69,14 +71,16 @@ unsafe extern "C" fn logger_callback(log: *const CassLogMessage, data: *mut raw:
     // it's fundamental to slog that the log level is statically known for a given invocation.
     // We can't do that in this case, so we have to use this tedious workaround.
     match log.severity {
-        CassLogLevel_::CASS_LOG_DISABLED |
-        CassLogLevel_::CASS_LOG_CRITICAL => crit!(logger, "{}", message; kv),
+        CassLogLevel_::CASS_LOG_DISABLED | CassLogLevel_::CASS_LOG_CRITICAL => {
+            crit!(logger, "{}", message; kv)
+        }
         CassLogLevel_::CASS_LOG_ERROR => error!(logger, "{}", message; kv),
         CassLogLevel_::CASS_LOG_WARN => warn!(logger, "{}", message; kv),
         CassLogLevel_::CASS_LOG_INFO => info!(logger, "{}", message; kv),
         CassLogLevel_::CASS_LOG_DEBUG => debug!(logger, "{}", message; kv),
-        CassLogLevel_::CASS_LOG_TRACE |
-        CassLogLevel_::CASS_LOG_LAST_ENTRY => trace!(logger, "{}", message; kv),
+        CassLogLevel_::CASS_LOG_TRACE | CassLogLevel_::CASS_LOG_LAST_ENTRY => {
+            trace!(logger, "{}", message; kv)
+        }
     };
 }
 
@@ -89,10 +93,8 @@ pub fn set_logger(logger: Option<slog::Logger>) {
                 // We don't expect this to be called many times, so we're not worried.
                 let data = Box::new(logger);
                 cass_log_set_callback(Some(logger_callback), Box::into_raw(data) as _)
-            },
-            None => {
-                cass_log_set_callback(None, ptr::null_mut())
-            },
+            }
+            None => cass_log_set_callback(None, ptr::null_mut()),
         }
     }
 }
diff --git a/src/cassandra/metrics.rs b/src/cassandra/metrics.rs
index 183c8e0..89471ac 100644
--- a/src/cassandra/metrics.rs
+++ b/src/cassandra/metrics.rs
@@ -1,5 +1,5 @@
-use cassandra::util::Protected;
-use cassandra_sys::CassMetrics as _CassMetrics;
+use crate::cassandra::util::Protected;
+use crate::cassandra_sys::CassMetrics as _CassMetrics;
 
 /// Metrics about the current session.
 #[allow(missing_docs)] // See DataStax docs
diff --git a/src/cassandra/policy/retry.rs b/src/cassandra/policy/retry.rs
index 8d0e78e..55cf128 100644
--- a/src/cassandra/policy/retry.rs
+++ b/src/cassandra/policy/retry.rs
@@ -1,10 +1,10 @@
-use cassandra::util::Protected;
-use cassandra_sys::CassRetryPolicy as _RetryPolicy;
-use cassandra_sys::cass_retry_policy_default_new;
-use cassandra_sys::cass_retry_policy_downgrading_consistency_new;
-use cassandra_sys::cass_retry_policy_fallthrough_new;
-use cassandra_sys::cass_retry_policy_free;
-use cassandra_sys::cass_retry_policy_logging_new;
+use crate::cassandra::util::Protected;
+use crate::cassandra_sys::cass_retry_policy_default_new;
+use crate::cassandra_sys::cass_retry_policy_downgrading_consistency_new;
+use crate::cassandra_sys::cass_retry_policy_fallthrough_new;
+use crate::cassandra_sys::cass_retry_policy_free;
+use crate::cassandra_sys::cass_retry_policy_logging_new;
+use crate::cassandra_sys::CassRetryPolicy as _RetryPolicy;
 
 /// The selected retry policy
 #[derive(Debug)]
@@ -15,13 +15,22 @@ pub struct RetryPolicy(*mut _RetryPolicy);
 unsafe impl Send for RetryPolicy {}
 
 impl Protected<*mut _RetryPolicy> for RetryPolicy {
-    fn inner(&self) -> *mut _RetryPolicy { self.0 }
-    fn build(inner: *mut _RetryPolicy) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; RetryPolicy(inner) }
+    fn inner(&self) -> *mut _RetryPolicy {
+        self.0
+    }
+    fn build(inner: *mut _RetryPolicy) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        RetryPolicy(inner)
+    }
 }
 
 impl RetryPolicy {
     /// The default retry policy
-    pub fn default_new() -> Self { unsafe { RetryPolicy::build(cass_retry_policy_default_new()) } }
+    pub fn default_new() -> Self {
+        unsafe { RetryPolicy::build(cass_retry_policy_default_new()) }
+    }
 
     /// An auto-CL-downgrading consistency level
     pub fn downgrading_consistency_new() -> Self {
@@ -29,7 +38,9 @@ impl RetryPolicy {
     }
 
     /// a fallthrough retry policy
-    pub fn fallthrough_new() -> Self { unsafe { RetryPolicy(cass_retry_policy_fallthrough_new()) } }
+    pub fn fallthrough_new() -> Self {
+        unsafe { RetryPolicy(cass_retry_policy_fallthrough_new()) }
+    }
 
     /// The a logging retry policy
     pub fn logging_new(child_retry_policy: RetryPolicy) -> Self {
diff --git a/src/cassandra/prepared.rs b/src/cassandra/prepared.rs
index e585b71..14a19e9 100644
--- a/src/cassandra/prepared.rs
+++ b/src/cassandra/prepared.rs
@@ -1,16 +1,16 @@
-use cassandra::data_type::ConstDataType;
-use cassandra::statement::Statement;
-use cassandra::util::Protected;
-use cassandra::error::*;
+use crate::cassandra::data_type::ConstDataType;
+use crate::cassandra::error::*;
+use crate::cassandra::statement::Statement;
+use crate::cassandra::util::Protected;
 
-use cassandra_sys::CassPrepared as _PreparedStatement;
-use cassandra_sys::cass_prepared_bind;
-use cassandra_sys::cass_prepared_free;
-use cassandra_sys::cass_prepared_parameter_data_type;
-use cassandra_sys::cass_prepared_parameter_data_type_by_name;
-use cassandra_sys::cass_prepared_parameter_name;
-use std::{mem, slice, str};
+use crate::cassandra_sys::cass_prepared_bind;
+use crate::cassandra_sys::cass_prepared_free;
+use crate::cassandra_sys::cass_prepared_parameter_data_type;
+use crate::cassandra_sys::cass_prepared_parameter_data_type_by_name;
+use crate::cassandra_sys::cass_prepared_parameter_name;
+use crate::cassandra_sys::CassPrepared as _PreparedStatement;
 use std::ffi::CString;
+use std::{mem, slice, str};
 
 /// A statement that has been prepared against at least one Cassandra node.
 /// Instances of this class should not be created directly, but through Session.prepare().
@@ -30,15 +30,23 @@ impl Drop for PreparedStatement {
     }
 }
 
-
 impl Protected<*const _PreparedStatement> for PreparedStatement {
-    fn inner(&self) -> *const _PreparedStatement { self.0 }
-    fn build(inner: *const _PreparedStatement) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; PreparedStatement(inner) }
+    fn inner(&self) -> *const _PreparedStatement {
+        self.0
+    }
+    fn build(inner: *const _PreparedStatement) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        PreparedStatement(inner)
+    }
 }
 
 impl PreparedStatement {
     /// Creates a bound statement from a pre-prepared statement.
-    pub fn bind(&self) -> Statement { unsafe { Statement::build(cass_prepared_bind(self.0)) } }
+    pub fn bind(&self) -> Statement {
+        unsafe { Statement::build(cass_prepared_bind(self.0)) }
+    }
 
     /// Gets the name of a parameter at the specified index.
     #[allow(cast_possible_truncation)]
@@ -46,11 +54,14 @@ impl PreparedStatement {
         unsafe {
             let mut name = mem::zeroed();
             let mut name_length = mem::zeroed();
-            cass_prepared_parameter_name(self.0, index, &mut name, &mut name_length).to_result(())
+            cass_prepared_parameter_name(self.0, index, &mut name, &mut name_length)
+                .to_result(())
                 .and_then(|_| {
-                    Ok(str::from_utf8(slice::from_raw_parts(name as *const u8, name_length as usize))?)
-                }
-            )
+                    Ok(str::from_utf8(slice::from_raw_parts(
+                        name as *const u8,
+                        name_length as usize,
+                    ))?)
+                })
         }
     }
 
@@ -69,8 +80,10 @@ impl PreparedStatement {
     pub fn parameter_data_type_by_name(&self, name: &str) -> ConstDataType {
         unsafe {
             let name_cstr = CString::new(name).expect("must be utf8");
-            ConstDataType::build(cass_prepared_parameter_data_type_by_name(self.0,
-                                                                    name_cstr.as_ptr()))
+            ConstDataType::build(cass_prepared_parameter_data_type_by_name(
+                self.0,
+                name_cstr.as_ptr(),
+            ))
         }
     }
 }
diff --git a/src/cassandra/result.rs b/src/cassandra/result.rs
index 1af891f..47a8ac0 100644
--- a/src/cassandra/result.rs
+++ b/src/cassandra/result.rs
@@ -2,29 +2,29 @@
 #![allow(dead_code)]
 #![allow(missing_copy_implementations)]
 
-use cassandra::data_type::ConstDataType;
-use cassandra::row::Row;
-use cassandra::util::Protected;
-use cassandra::value::ValueType;
-use cassandra::error::*;
-
-use cassandra_sys::CassIterator as _CassIterator;
-use cassandra_sys::CassResult as _CassResult;
-use cassandra_sys::cass_false;
-use cassandra_sys::cass_iterator_free;
-use cassandra_sys::cass_iterator_from_result;
-use cassandra_sys::cass_iterator_get_row;
-use cassandra_sys::cass_iterator_next;
-use cassandra_sys::cass_result_column_count;
-use cassandra_sys::cass_result_column_data_type;
-use cassandra_sys::cass_result_column_name;
-use cassandra_sys::cass_result_column_type;
-use cassandra_sys::cass_result_first_row;
-use cassandra_sys::cass_result_free;
-use cassandra_sys::cass_result_has_more_pages;
-use cassandra_sys::cass_result_paging_state_token;
-use cassandra_sys::cass_result_row_count;
-use cassandra_sys::cass_true;
+use crate::cassandra::data_type::ConstDataType;
+use crate::cassandra::error::*;
+use crate::cassandra::row::Row;
+use crate::cassandra::util::Protected;
+use crate::cassandra::value::ValueType;
+
+use crate::cassandra_sys::cass_false;
+use crate::cassandra_sys::cass_iterator_free;
+use crate::cassandra_sys::cass_iterator_from_result;
+use crate::cassandra_sys::cass_iterator_get_row;
+use crate::cassandra_sys::cass_iterator_next;
+use crate::cassandra_sys::cass_result_column_count;
+use crate::cassandra_sys::cass_result_column_data_type;
+use crate::cassandra_sys::cass_result_column_name;
+use crate::cassandra_sys::cass_result_column_type;
+use crate::cassandra_sys::cass_result_first_row;
+use crate::cassandra_sys::cass_result_free;
+use crate::cassandra_sys::cass_result_has_more_pages;
+use crate::cassandra_sys::cass_result_paging_state_token;
+use crate::cassandra_sys::cass_result_row_count;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::CassIterator as _CassIterator;
+use crate::cassandra_sys::CassResult as _CassResult;
 
 use std::ffi::CString;
 use std::fmt;
@@ -44,8 +44,15 @@ unsafe impl Sync for CassResult {}
 unsafe impl Send for CassResult {}
 
 impl Protected<*const _CassResult> for CassResult {
-    fn inner(&self) -> *const _CassResult { self.0 }
-    fn build(inner: *const _CassResult) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; CassResult(inner) }
+    fn inner(&self) -> *const _CassResult {
+        self.0
+    }
+    fn build(inner: *const _CassResult) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        CassResult(inner)
+    }
 }
 
 impl Debug for CassResult {
@@ -68,30 +75,34 @@ impl Display for CassResult {
     }
 }
 
- impl Drop for CassResult {
+impl Drop for CassResult {
     fn drop(&mut self) {
         unsafe { cass_result_free(self.0) }
     }
- }
+}
 
 impl CassResult {
     /// Gets the number of rows for the specified result.
-    pub fn row_count(&self) -> u64 { unsafe { cass_result_row_count(self.0) as u64 } }
+    pub fn row_count(&self) -> u64 {
+        unsafe { cass_result_row_count(self.0) as u64 }
+    }
 
     /// Gets the number of columns per row for the specified result.
-    pub fn column_count(&self) -> u64 { unsafe { cass_result_column_count(self.0) as u64 } }
+    pub fn column_count(&self) -> u64 {
+        unsafe { cass_result_column_count(self.0) as u64 }
+    }
 
     /// Gets the column name at index for the specified result.
     pub fn column_name(&self, index: usize) -> Result<&str> {
         unsafe {
             let mut name = mem::zeroed();
             let mut name_length = mem::zeroed();
-            cass_result_column_name(self.0, index, &mut name, &mut name_length).to_result(())
+            cass_result_column_name(self.0, index, &mut name, &mut name_length)
+                .to_result(())
                 .and_then(|_| {
                     let slice = slice::from_raw_parts(name as *const u8, name_length as usize);
                     Ok(str::from_utf8(slice)?)
-                }
-            )
+                })
         }
     }
 
@@ -117,7 +128,9 @@ impl CassResult {
     }
 
     /// Returns true if there are more pages.
-    pub fn has_more_pages(&self) -> bool { unsafe { cass_result_has_more_pages(self.0) == cass_true } }
+    pub fn has_more_pages(&self) -> bool {
+        unsafe { cass_result_has_more_pages(self.0) == cass_true }
+    }
 
     /// Sets the statement's paging state. This can be used to get the next page of
     /// data in a multi-page query.
@@ -128,15 +141,20 @@ impl CassResult {
     pub fn set_paging_state_token(&mut self, paging_state: &str) -> Result<&mut Self> {
         unsafe {
             let state = CString::new(paging_state)?;
-            cass_result_paging_state_token(self.0, &mut state.as_ptr(), &mut (state.to_bytes().len()))
-                .to_result(self)
+            cass_result_paging_state_token(
+                self.0,
+                &mut state.as_ptr(),
+                &mut (state.to_bytes().len()),
+            )
+            .to_result(self)
         }
     }
 
-
     /// Creates a new iterator for the specified result. This can be
     /// used to iterate over rows in the result.
-    pub fn iter(&self) -> ResultIterator { unsafe { ResultIterator(cass_iterator_from_result(self.0), PhantomData) } }
+    pub fn iter(&self) -> ResultIterator {
+        unsafe { ResultIterator(cass_iterator_from_result(self.0), PhantomData) }
+    }
 }
 
 /// An iterator over the results of a query.
@@ -149,7 +167,9 @@ pub struct ResultIterator<'a>(pub *mut _CassIterator, PhantomData<&'a CassResult
 unsafe impl<'a> Send for ResultIterator<'a> {}
 
 impl<'a> Drop for ResultIterator<'a> {
-    fn drop(&mut self) { unsafe { cass_iterator_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_iterator_free(self.0) }
+    }
 }
 
 impl<'a> Iterator for ResultIterator<'a> {
@@ -166,12 +186,16 @@ impl<'a> Iterator for ResultIterator<'a> {
 
 impl<'a> ResultIterator<'a> {
     /// Gets the next row in the result set
-    pub fn get_row(&mut self) -> Row { unsafe { Row::build(cass_iterator_get_row(self.0)) } }
+    pub fn get_row(&mut self) -> Row {
+        unsafe { Row::build(cass_iterator_get_row(self.0)) }
+    }
 }
 
 impl<'a> IntoIterator for &'a CassResult {
     type Item = Row;
     type IntoIter = ResultIterator<'a>;
 
-    fn into_iter(self) -> Self::IntoIter { self.iter() }
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
 }
diff --git a/src/cassandra/row.rs b/src/cassandra/row.rs
index 1c8870b..4e3151f 100644
--- a/src/cassandra/row.rs
+++ b/src/cassandra/row.rs
@@ -1,20 +1,20 @@
-use cassandra::error::*;
-
-use cassandra::iterator::{MapIterator, SetIterator, UserTypeIterator};
-use cassandra::util::Protected;
-use cassandra::value::Value;
-use cassandra::inet::Inet;
-use cassandra::uuid::Uuid;
-use cassandra_sys::CassIterator as _CassIterator;
-use cassandra_sys::CassRow as _Row;
-use cassandra_sys::cass_false;
-use cassandra_sys::cass_iterator_free;
-use cassandra_sys::cass_iterator_from_row;
-use cassandra_sys::cass_iterator_get_column;
-use cassandra_sys::cass_iterator_next;
-use cassandra_sys::cass_row_get_column;
-use cassandra_sys::cass_row_get_column_by_name;
-use cassandra_sys::cass_true;
+use crate::cassandra::error::*;
+
+use crate::cassandra::inet::Inet;
+use crate::cassandra::iterator::{MapIterator, SetIterator, UserTypeIterator};
+use crate::cassandra::util::Protected;
+use crate::cassandra::uuid::Uuid;
+use crate::cassandra::value::Value;
+use crate::cassandra_sys::cass_false;
+use crate::cassandra_sys::cass_iterator_free;
+use crate::cassandra_sys::cass_iterator_from_row;
+use crate::cassandra_sys::cass_iterator_get_column;
+use crate::cassandra_sys::cass_iterator_next;
+use crate::cassandra_sys::cass_row_get_column;
+use crate::cassandra_sys::cass_row_get_column_by_name;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::CassIterator as _CassIterator;
+use crate::cassandra_sys::CassRow as _Row;
 use std::ffi::CString;
 use std::fmt;
 use std::fmt::Debug;
@@ -30,8 +30,15 @@ unsafe impl Sync for Row {}
 unsafe impl Send for Row {}
 
 impl Protected<*const _Row> for Row {
-    fn inner(&self) -> *const _Row { self.0 }
-    fn build(inner: *const _Row) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Row(inner) }
+    fn inner(&self) -> *const _Row {
+        self.0
+    }
+    fn build(inner: *const _Row) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Row(inner)
+    }
 }
 
 impl Debug for Row {
@@ -59,7 +66,8 @@ pub trait AsRustType<T> {
 
     /// convert while reading cassandra columns by name
     fn get_by_name<S>(&self, name: S) -> Result<T>
-        where S: Into<String>;
+    where
+        S: Into<String>;
 }
 
 impl AsRustType<bool> for Row {
@@ -69,7 +77,9 @@ impl AsRustType<bool> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<bool>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         self.get_column_by_name(name)?.get_bool()
     }
 }
@@ -81,7 +91,9 @@ impl AsRustType<String> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<String>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_string()
     }
@@ -94,7 +106,9 @@ impl AsRustType<f64> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<f64>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_f64()
     }
@@ -107,7 +121,9 @@ impl AsRustType<f32> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<f32>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_f32()
     }
@@ -120,7 +136,9 @@ impl AsRustType<i64> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<i64>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_i64()
     }
@@ -133,7 +151,9 @@ impl AsRustType<i32> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<i32>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_i32()
     }
@@ -146,7 +166,9 @@ impl AsRustType<i16> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<i16>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_i16()
     }
@@ -159,7 +181,9 @@ impl AsRustType<i8> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<i8>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_i8()
     }
@@ -172,7 +196,9 @@ impl AsRustType<u32> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<u32>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_u32()
     }
@@ -185,7 +211,9 @@ impl AsRustType<Inet> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<Inet>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_inet()
     }
@@ -198,7 +226,9 @@ impl AsRustType<SetIterator> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<SetIterator>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_set()
     }
@@ -211,7 +241,9 @@ impl AsRustType<MapIterator> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<MapIterator>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_map()
     }
@@ -224,7 +256,9 @@ impl AsRustType<UserTypeIterator> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<UserTypeIterator>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_user_type()
     }
@@ -237,7 +271,9 @@ impl AsRustType<Uuid> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<Uuid>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_uuid()
     }
@@ -250,7 +286,9 @@ impl AsRustType<Vec<u8>> for Row {
     }
 
     fn get_by_name<S>(&self, name: S) -> Result<Vec<u8>>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         let col = self.get_column_by_name(name)?;
         col.get_bytes().map(|b| b.to_vec())
     }
@@ -271,11 +309,12 @@ impl Row {
 
     /// Get a particular column by name
     pub fn get_column_by_name<S>(&self, name: S) -> Result<Value>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name_cstr = CString::new(name.into())?;
-            let col = cass_row_get_column_by_name(self.0,
-                                                  name_cstr.as_ptr());
+            let col = cass_row_get_column_by_name(self.0, name_cstr.as_ptr());
             if col.is_null() {
                 Err(CassErrorCode::LIB_INDEX_OUT_OF_BOUNDS.to_error())
             } else {
@@ -294,7 +333,9 @@ pub struct RowIterator(pub *mut _CassIterator);
 unsafe impl Send for RowIterator {}
 
 impl Drop for RowIterator {
-    fn drop(&mut self) { unsafe { cass_iterator_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_iterator_free(self.0) }
+    }
 }
 
 impl iter::Iterator for RowIterator {
@@ -338,11 +379,15 @@ impl IntoIterator for Row {
 
     /// Creates a new iterator for the specified row. This can be
     /// used to iterate over columns in a row.
-    fn into_iter(self) -> Self::IntoIter { unsafe { RowIterator(cass_iterator_from_row(self.0)) } }
+    fn into_iter(self) -> Self::IntoIter {
+        unsafe { RowIterator(cass_iterator_from_row(self.0)) }
+    }
 }
 
 impl<'a> IntoIterator for &'a Row {
     type Item = Value;
     type IntoIter = RowIterator;
-    fn into_iter(self) -> Self::IntoIter { unsafe { RowIterator(cass_iterator_from_row(self.0)) } }
+    fn into_iter(self) -> Self::IntoIter {
+        unsafe { RowIterator(cass_iterator_from_row(self.0)) }
+    }
 }
diff --git a/src/cassandra/schema/aggregate_meta.rs b/src/cassandra/schema/aggregate_meta.rs
index c959259..586d9ff 100644
--- a/src/cassandra/schema/aggregate_meta.rs
+++ b/src/cassandra/schema/aggregate_meta.rs
@@ -1,34 +1,40 @@
-use cassandra::data_type::ConstDataType;
-use cassandra::iterator::FieldIterator;
-
-use cassandra::schema::function_meta::FunctionMeta;
-use cassandra::util::Protected;
-use cassandra::value::Value;
-
-use cassandra_sys::CassAggregateMeta as _CassAggregateMeta;
-use cassandra_sys::cass_aggregate_meta_argument_count;
-use cassandra_sys::cass_aggregate_meta_argument_type;
-use cassandra_sys::cass_aggregate_meta_field_by_name;
-use cassandra_sys::cass_aggregate_meta_final_func;
-use cassandra_sys::cass_aggregate_meta_full_name;
-use cassandra_sys::cass_aggregate_meta_init_cond;
-use cassandra_sys::cass_aggregate_meta_name;
-use cassandra_sys::cass_aggregate_meta_return_type;
-use cassandra_sys::cass_aggregate_meta_state_func;
-use cassandra_sys::cass_aggregate_meta_state_type;
-use cassandra_sys::cass_iterator_fields_from_aggregate_meta;
-use cassandra_sys::raw2utf8;
+use crate::cassandra::data_type::ConstDataType;
+use crate::cassandra::iterator::FieldIterator;
+
+use crate::cassandra::schema::function_meta::FunctionMeta;
+use crate::cassandra::util::Protected;
+use crate::cassandra::value::Value;
+
+use crate::cassandra_sys::cass_aggregate_meta_argument_count;
+use crate::cassandra_sys::cass_aggregate_meta_argument_type;
+use crate::cassandra_sys::cass_aggregate_meta_field_by_name;
+use crate::cassandra_sys::cass_aggregate_meta_final_func;
+use crate::cassandra_sys::cass_aggregate_meta_full_name;
+use crate::cassandra_sys::cass_aggregate_meta_init_cond;
+use crate::cassandra_sys::cass_aggregate_meta_name;
+use crate::cassandra_sys::cass_aggregate_meta_return_type;
+use crate::cassandra_sys::cass_aggregate_meta_state_func;
+use crate::cassandra_sys::cass_aggregate_meta_state_type;
+use crate::cassandra_sys::cass_iterator_fields_from_aggregate_meta;
+use crate::cassandra_sys::raw2utf8;
+use crate::cassandra_sys::CassAggregateMeta as _CassAggregateMeta;
 use std::ffi::CString;
 use std::mem;
 
-
 /// Metadata about a cassandra aggregate
 #[derive(Debug)]
 pub struct AggregateMeta(*const _CassAggregateMeta);
 
 impl Protected<*const _CassAggregateMeta> for AggregateMeta {
-    fn inner(&self) -> *const _CassAggregateMeta { self.0 }
-    fn build(inner: *const _CassAggregateMeta) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; AggregateMeta(inner) }
+    fn inner(&self) -> *const _CassAggregateMeta {
+        self.0
+    }
+    fn build(inner: *const _CassAggregateMeta) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        AggregateMeta(inner)
+    }
 }
 
 impl AggregateMeta {
@@ -37,7 +43,6 @@ impl AggregateMeta {
         unsafe { FieldIterator::build(cass_iterator_fields_from_aggregate_meta(self.0)) }
     }
 
-
     /// Gets the name of the aggregate.
     pub fn get_name(&self) -> String {
         unsafe {
@@ -59,7 +64,9 @@ impl AggregateMeta {
     }
 
     /// Gets the number of arguments this aggregate takes.
-    pub fn argument_count(&self) -> usize { unsafe { cass_aggregate_meta_argument_count(self.0) } }
+    pub fn argument_count(&self) -> usize {
+        unsafe { cass_aggregate_meta_argument_count(self.0) }
+    }
 
     /// Gets the aggregate's argument type for the provided index.
     pub fn argument_type(&self, index: usize) -> ConstDataType {
@@ -68,19 +75,29 @@ impl AggregateMeta {
     }
 
     /// Gets the aggregate's argument return type.
-    pub fn return_type(&self) -> ConstDataType { unsafe { ConstDataType::build(cass_aggregate_meta_return_type(self.0)) } }
+    pub fn return_type(&self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_aggregate_meta_return_type(self.0)) }
+    }
 
     /// Gets the aggregate's argument state type.
-    pub fn state_type(&self) -> ConstDataType { unsafe { ConstDataType::build(cass_aggregate_meta_state_type(self.0)) } }
+    pub fn state_type(&self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_aggregate_meta_state_type(self.0)) }
+    }
 
     /// Gets the function metadata for the aggregate's state function.
-    pub fn state_func(&self) -> FunctionMeta { unsafe { FunctionMeta::build(cass_aggregate_meta_state_func(self.0)) } }
+    pub fn state_func(&self) -> FunctionMeta {
+        unsafe { FunctionMeta::build(cass_aggregate_meta_state_func(self.0)) }
+    }
 
     /// Gets the function metadata for the aggregates's final function.
-    pub fn final_func(&self) -> FunctionMeta { unsafe { FunctionMeta::build(cass_aggregate_meta_final_func(self.0)) } }
+    pub fn final_func(&self) -> FunctionMeta {
+        unsafe { FunctionMeta::build(cass_aggregate_meta_final_func(self.0)) }
+    }
 
     ///  Gets the initial condition value for the aggregate.
-    pub fn init_cond(&self) -> Value { unsafe { Value::build(cass_aggregate_meta_init_cond(self.0)) } }
+    pub fn init_cond(&self) -> Value {
+        unsafe { Value::build(cass_aggregate_meta_init_cond(self.0)) }
+    }
 
     ///  Gets a metadata field for the provided name. Metadata fields allow direct
     /// access to the column data found in the underlying "aggregates" metadata table.
diff --git a/src/cassandra/schema/column_meta.rs b/src/cassandra/schema/column_meta.rs
index 7be9874..9fbda5b 100644
--- a/src/cassandra/schema/column_meta.rs
+++ b/src/cassandra/schema/column_meta.rs
@@ -1,15 +1,15 @@
-use cassandra::data_type::ConstDataType;
+use crate::cassandra::data_type::ConstDataType;
 
-use cassandra::iterator::FieldIterator;
-use cassandra::util::Protected;
-use cassandra::value::Value;
-use cassandra_sys::CassColumnMeta as _CassColumnMeta;
-use cassandra_sys::CassColumnType as _CassColumnType;
-use cassandra_sys::cass_column_meta_data_type;
-use cassandra_sys::cass_column_meta_field_by_name;
-use cassandra_sys::cass_column_meta_name;
-use cassandra_sys::cass_column_meta_type;
-use cassandra_sys::cass_iterator_fields_from_column_meta;
+use crate::cassandra::iterator::FieldIterator;
+use crate::cassandra::util::Protected;
+use crate::cassandra::value::Value;
+use crate::cassandra_sys::cass_column_meta_data_type;
+use crate::cassandra_sys::cass_column_meta_field_by_name;
+use crate::cassandra_sys::cass_column_meta_name;
+use crate::cassandra_sys::cass_column_meta_type;
+use crate::cassandra_sys::cass_iterator_fields_from_column_meta;
+use crate::cassandra_sys::CassColumnMeta as _CassColumnMeta;
+use crate::cassandra_sys::CassColumnType as _CassColumnType;
 
 /// Column metadata
 #[derive(Debug)]
@@ -21,11 +21,17 @@ use std::slice;
 use std::str;
 
 impl Protected<*const _CassColumnMeta> for ColumnMeta {
-    fn inner(&self) -> *const _CassColumnMeta { self.0 }
-    fn build(inner: *const _CassColumnMeta) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; ColumnMeta(inner) }
+    fn inner(&self) -> *const _CassColumnMeta {
+        self.0
+    }
+    fn build(inner: *const _CassColumnMeta) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        ColumnMeta(inner)
+    }
 }
 
-
 impl ColumnMeta {
     /// returns an iterator over the fields of this column
     pub fn field_iter(&mut self) -> FieldIterator {
@@ -45,10 +51,14 @@ impl ColumnMeta {
     }
 
     /// Gets the type of the column.
-    pub fn get_type(&self) -> _CassColumnType { unsafe { cass_column_meta_type(self.0) } }
+    pub fn get_type(&self) -> _CassColumnType {
+        unsafe { cass_column_meta_type(self.0) }
+    }
 
     /// Gets the data type of the column.
-    pub fn data_type(&self) -> ConstDataType { unsafe { ConstDataType::build(cass_column_meta_data_type(self.0)) } }
+    pub fn data_type(&self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_column_meta_data_type(self.0)) }
+    }
 
     /// Gets a metadata field for the provided name. Metadata fields allow direct
     /// access to the column data found in the underlying "columns" metadata table.
diff --git a/src/cassandra/schema/function_meta.rs b/src/cassandra/schema/function_meta.rs
index 4cf7e7f..9606f9e 100644
--- a/src/cassandra/schema/function_meta.rs
+++ b/src/cassandra/schema/function_meta.rs
@@ -1,34 +1,41 @@
-use cassandra::data_type::ConstDataType;
-use cassandra::iterator::FieldIterator;
-use cassandra::util::Protected;
-use cassandra::value::Value;
-use cassandra::error::*;
-
-use cassandra_sys::CASS_OK;
-use cassandra_sys::CassFunctionMeta as _CassFunctionMeta;
-use cassandra_sys::cass_function_meta_argument;
-use cassandra_sys::cass_function_meta_argument_count;
-use cassandra_sys::cass_function_meta_argument_type_by_name;
-use cassandra_sys::cass_function_meta_body;
-use cassandra_sys::cass_function_meta_called_on_null_input;
-use cassandra_sys::cass_function_meta_field_by_name;
-use cassandra_sys::cass_function_meta_full_name;
-use cassandra_sys::cass_function_meta_language;
-use cassandra_sys::cass_function_meta_name;
-use cassandra_sys::cass_function_meta_return_type;
-use cassandra_sys::cass_iterator_fields_from_function_meta;
-use cassandra_sys::cass_true;
+use crate::cassandra::data_type::ConstDataType;
+use crate::cassandra::error::*;
+use crate::cassandra::iterator::FieldIterator;
+use crate::cassandra::util::Protected;
+use crate::cassandra::value::Value;
+
+use crate::cassandra_sys::cass_function_meta_argument;
+use crate::cassandra_sys::cass_function_meta_argument_count;
+use crate::cassandra_sys::cass_function_meta_argument_type_by_name;
+use crate::cassandra_sys::cass_function_meta_body;
+use crate::cassandra_sys::cass_function_meta_called_on_null_input;
+use crate::cassandra_sys::cass_function_meta_field_by_name;
+use crate::cassandra_sys::cass_function_meta_full_name;
+use crate::cassandra_sys::cass_function_meta_language;
+use crate::cassandra_sys::cass_function_meta_name;
+use crate::cassandra_sys::cass_function_meta_return_type;
+use crate::cassandra_sys::cass_iterator_fields_from_function_meta;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::CassFunctionMeta as _CassFunctionMeta;
+use crate::cassandra_sys::CASS_OK;
 
-use std::{mem, slice, str};
 use std::ffi::CString;
+use std::{mem, slice, str};
 
 /// The metadata for a function
 #[derive(Debug)]
 pub struct FunctionMeta(*const _CassFunctionMeta);
 
 impl Protected<*const _CassFunctionMeta> for FunctionMeta {
-    fn inner(&self) -> *const _CassFunctionMeta { self.0 }
-    fn build(inner: *const _CassFunctionMeta) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; FunctionMeta(inner) }
+    fn inner(&self) -> *const _CassFunctionMeta {
+        self.0
+    }
+    fn build(inner: *const _CassFunctionMeta) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        FunctionMeta(inner)
+    }
 }
 
 impl FunctionMeta {
@@ -44,9 +51,12 @@ impl FunctionMeta {
             let mut name = mem::zeroed();
             let mut name_length = mem::zeroed();
             cass_function_meta_name(self.0, &mut name, &mut name_length);
-            str::from_utf8(slice::from_raw_parts(name as *const u8, name_length as usize))
-                .expect("must be utf8")
-                .to_owned()
+            str::from_utf8(slice::from_raw_parts(
+                name as *const u8,
+                name_length as usize,
+            ))
+            .expect("must be utf8")
+            .to_owned()
         }
     }
 
@@ -59,9 +69,12 @@ impl FunctionMeta {
             let mut name = mem::zeroed();
             let mut name_length = mem::zeroed();
             cass_function_meta_full_name(self.0, &mut name, &mut name_length);
-            str::from_utf8(slice::from_raw_parts(name as *const u8, name_length as usize))
-                .expect("must be utf8")
-                .to_owned()
+            str::from_utf8(slice::from_raw_parts(
+                name as *const u8,
+                name_length as usize,
+            ))
+            .expect("must be utf8")
+            .to_owned()
         }
     }
 
@@ -72,9 +85,12 @@ impl FunctionMeta {
             let mut name = mem::zeroed();
             let mut name_length = mem::zeroed();
             cass_function_meta_body(self.0, &mut name, &mut name_length);
-            str::from_utf8(slice::from_raw_parts(name as *const u8, name_length as usize))
-                .expect("must be utf8")
-                .to_owned()
+            str::from_utf8(slice::from_raw_parts(
+                name as *const u8,
+                name_length as usize,
+            ))
+            .expect("must be utf8")
+            .to_owned()
         }
     }
 
@@ -85,9 +101,12 @@ impl FunctionMeta {
             let mut name = mem::zeroed();
             let mut name_length = mem::zeroed();
             cass_function_meta_language(self.0, &mut name, &mut name_length);
-            str::from_utf8(slice::from_raw_parts(name as *const u8, name_length as usize))
-                .expect("must be utf8")
-                .to_owned()
+            str::from_utf8(slice::from_raw_parts(
+                name as *const u8,
+                name_length as usize,
+            ))
+            .expect("must be utf8")
+            .to_owned()
         }
     }
 
@@ -97,7 +116,9 @@ impl FunctionMeta {
     }
 
     /// Gets the number of arguments this function takes.
-    pub fn argument_count(&self) -> usize { unsafe { cass_function_meta_argument_count(self.0) } }
+    pub fn argument_count(&self) -> usize {
+        unsafe { cass_function_meta_argument_count(self.0) }
+    }
 
     /// Gets the function's argument name and type for the provided index.
     pub fn argument(&self, index: usize) -> Result<()> {
@@ -106,7 +127,8 @@ impl FunctionMeta {
             let mut name_length = mem::zeroed();
             let mut data_type = mem::zeroed();
 
-            cass_function_meta_argument(self.0, index, &mut name, &mut name_length, &mut data_type).to_result(())
+            cass_function_meta_argument(self.0, index, &mut name, &mut name_length, &mut data_type)
+                .to_result(())
         }
     }
 
@@ -115,12 +137,17 @@ impl FunctionMeta {
         unsafe {
             let name_cstr = CString::new(name).expect("must be utf8");
             // TODO: can return NULL
-            ConstDataType::build(cass_function_meta_argument_type_by_name(self.0, name_cstr.as_ptr()))
+            ConstDataType::build(cass_function_meta_argument_type_by_name(
+                self.0,
+                name_cstr.as_ptr(),
+            ))
         }
     }
 
     /// Gets the return type of the function.
-    pub fn return_type(&self) -> ConstDataType { unsafe { ConstDataType::build(cass_function_meta_return_type(self.0)) } }
+    pub fn return_type(&self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_function_meta_return_type(self.0)) }
+    }
 
     /// Gets a metadata field for the provided name. Metadata fields allow direct
     /// access to the column data found in the underlying "functions" metadata table.
diff --git a/src/cassandra/schema/keyspace_meta.rs b/src/cassandra/schema/keyspace_meta.rs
index de4066a..daf18f8 100644
--- a/src/cassandra/schema/keyspace_meta.rs
+++ b/src/cassandra/schema/keyspace_meta.rs
@@ -1,30 +1,30 @@
-use cassandra::data_type::ConstDataType;
-use cassandra::iterator::AggregateIterator;
-use cassandra::iterator::FieldIterator;
-use cassandra::iterator::FunctionIterator;
-use cassandra::iterator::TableIterator;
-use cassandra::iterator::UserTypeIterator;
-use cassandra::schema::aggregate_meta::AggregateMeta;
-
-use cassandra::schema::function_meta::FunctionMeta;
-use cassandra::schema::table_meta::TableMeta;
-use cassandra::util::Protected;
-
-use cassandra_sys::CassKeyspaceMeta as _CassKeyspaceMeta;
-use cassandra_sys::CassValue as _CassValue;
-use cassandra_sys::cass_iterator_aggregates_from_keyspace_meta;
-use cassandra_sys::cass_iterator_fields_from_keyspace_meta;
-use cassandra_sys::cass_iterator_functions_from_keyspace_meta;
-
-use cassandra_sys::cass_iterator_tables_from_keyspace_meta;
-use cassandra_sys::cass_iterator_user_types_from_keyspace_meta;
-use cassandra_sys::cass_keyspace_meta_aggregate_by_name;
-use cassandra_sys::cass_keyspace_meta_field_by_name;
-use cassandra_sys::cass_keyspace_meta_function_by_name;
-use cassandra_sys::cass_keyspace_meta_name;
-use cassandra_sys::cass_keyspace_meta_table_by_name;
-use cassandra_sys::cass_keyspace_meta_user_type_by_name;
-use cassandra_sys::raw2utf8;
+use crate::cassandra::data_type::ConstDataType;
+use crate::cassandra::iterator::AggregateIterator;
+use crate::cassandra::iterator::FieldIterator;
+use crate::cassandra::iterator::FunctionIterator;
+use crate::cassandra::iterator::TableIterator;
+use crate::cassandra::iterator::UserTypeIterator;
+use crate::cassandra::schema::aggregate_meta::AggregateMeta;
+
+use crate::cassandra::schema::function_meta::FunctionMeta;
+use crate::cassandra::schema::table_meta::TableMeta;
+use crate::cassandra::util::Protected;
+
+use crate::cassandra_sys::cass_iterator_aggregates_from_keyspace_meta;
+use crate::cassandra_sys::cass_iterator_fields_from_keyspace_meta;
+use crate::cassandra_sys::cass_iterator_functions_from_keyspace_meta;
+use crate::cassandra_sys::CassKeyspaceMeta as _CassKeyspaceMeta;
+use crate::cassandra_sys::CassValue as _CassValue;
+
+use crate::cassandra_sys::cass_iterator_tables_from_keyspace_meta;
+use crate::cassandra_sys::cass_iterator_user_types_from_keyspace_meta;
+use crate::cassandra_sys::cass_keyspace_meta_aggregate_by_name;
+use crate::cassandra_sys::cass_keyspace_meta_field_by_name;
+use crate::cassandra_sys::cass_keyspace_meta_function_by_name;
+use crate::cassandra_sys::cass_keyspace_meta_name;
+use crate::cassandra_sys::cass_keyspace_meta_table_by_name;
+use crate::cassandra_sys::cass_keyspace_meta_user_type_by_name;
+use crate::cassandra_sys::raw2utf8;
 use std::ffi::CString;
 use std::mem;
 
@@ -33,8 +33,15 @@ use std::mem;
 pub struct KeyspaceMeta(*const _CassKeyspaceMeta);
 
 impl Protected<*const _CassKeyspaceMeta> for KeyspaceMeta {
-    fn inner(&self) -> *const _CassKeyspaceMeta { self.0 }
-    fn build(inner: *const _CassKeyspaceMeta) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; KeyspaceMeta(inner) }
+    fn inner(&self) -> *const _CassKeyspaceMeta {
+        self.0
+    }
+    fn build(inner: *const _CassKeyspaceMeta) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        KeyspaceMeta(inner)
+    }
 }
 
 #[derive(Debug)]
@@ -81,11 +88,12 @@ impl KeyspaceMeta {
     pub fn get_function_by_name(&self, name: &str, arguments: Vec<&str>) -> Option<FunctionMeta> {
         unsafe {
             let name_cstr = CString::new(name).expect("must be utf8");
-            let arguments_cstr = CString::new(arguments.join(","))
-                .expect("must be utf8");
-            let value = cass_keyspace_meta_function_by_name(self.0,
-                                                            name_cstr.as_ptr(),
-                                                            arguments_cstr.as_ptr());
+            let arguments_cstr = CString::new(arguments.join(",")).expect("must be utf8");
+            let value = cass_keyspace_meta_function_by_name(
+                self.0,
+                name_cstr.as_ptr(),
+                arguments_cstr.as_ptr(),
+            );
             if value.is_null() {
                 None
             } else {
@@ -99,9 +107,11 @@ impl KeyspaceMeta {
         unsafe {
             let name_cstr = CString::new(name).expect("must be utf8");
             let arguments_cstr = CString::new(arguments.join(",")).expect("must be utf8");
-            let agg = cass_keyspace_meta_aggregate_by_name(self.0,
-                                                           name_cstr.as_ptr(),
-                                                           arguments_cstr.as_ptr());
+            let agg = cass_keyspace_meta_aggregate_by_name(
+                self.0,
+                name_cstr.as_ptr(),
+                arguments_cstr.as_ptr(),
+            );
             if agg.is_null() {
                 None
             } else {
diff --git a/src/cassandra/schema/mod.rs b/src/cassandra/schema/mod.rs
index 3b8bda1..68a6228 100644
--- a/src/cassandra/schema/mod.rs
+++ b/src/cassandra/schema/mod.rs
@@ -1,6 +1,6 @@
+pub mod aggregate_meta;
+pub mod column_meta;
+pub mod function_meta;
 pub mod keyspace_meta;
 pub mod schema_meta;
-pub mod column_meta;
 pub mod table_meta;
-pub mod function_meta;
-pub mod aggregate_meta;
diff --git a/src/cassandra/schema/schema_meta.rs b/src/cassandra/schema/schema_meta.rs
index c0e0215..94a1775 100644
--- a/src/cassandra/schema/schema_meta.rs
+++ b/src/cassandra/schema/schema_meta.rs
@@ -1,12 +1,12 @@
-use cassandra::iterator::KeyspaceIterator;
+use crate::cassandra::iterator::KeyspaceIterator;
 
-use cassandra::schema::keyspace_meta::KeyspaceMeta;
-use cassandra::util::Protected;
-use cassandra_sys::CassSchemaMeta as _CassSchemaMeta;
-use cassandra_sys::cass_iterator_keyspaces_from_schema_meta;
-use cassandra_sys::cass_schema_meta_free;
-use cassandra_sys::cass_schema_meta_keyspace_by_name;
-use cassandra_sys::cass_schema_meta_snapshot_version;
+use crate::cassandra::schema::keyspace_meta::KeyspaceMeta;
+use crate::cassandra::util::Protected;
+use crate::cassandra_sys::cass_iterator_keyspaces_from_schema_meta;
+use crate::cassandra_sys::cass_schema_meta_free;
+use crate::cassandra_sys::cass_schema_meta_keyspace_by_name;
+use crate::cassandra_sys::cass_schema_meta_snapshot_version;
+use crate::cassandra_sys::CassSchemaMeta as _CassSchemaMeta;
 use std::ffi::CString;
 
 /// A snapshot of the schema's metadata
@@ -22,20 +22,32 @@ impl Drop for SchemaMeta {
 }
 
 impl Protected<*const _CassSchemaMeta> for SchemaMeta {
-    fn inner(&self) -> *const _CassSchemaMeta { self.0 }
-    fn build(inner: *const _CassSchemaMeta) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; SchemaMeta(inner) }
+    fn inner(&self) -> *const _CassSchemaMeta {
+        self.0
+    }
+    fn build(inner: *const _CassSchemaMeta) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        SchemaMeta(inner)
+    }
 }
 
 impl SchemaMeta {
     /// Gets the version of the schema metadata snapshot.
-    pub fn snapshot_version(&self) -> u32 { unsafe { cass_schema_meta_snapshot_version(self.0) } }
+    pub fn snapshot_version(&self) -> u32 {
+        unsafe { cass_schema_meta_snapshot_version(self.0) }
+    }
 
     /// Gets the keyspace metadata for the provided keyspace name.
     pub fn get_keyspace_by_name(&self, keyspace: &str) -> KeyspaceMeta {
         // TODO: can return NULL
         unsafe {
             let keyspace_cstr = CString::new(keyspace).expect("Unable to convert string to bytes");
-            KeyspaceMeta::build(cass_schema_meta_keyspace_by_name(self.0, keyspace_cstr.as_ptr()))
+            KeyspaceMeta::build(cass_schema_meta_keyspace_by_name(
+                self.0,
+                keyspace_cstr.as_ptr(),
+            ))
         }
     }
 
diff --git a/src/cassandra/schema/table_meta.rs b/src/cassandra/schema/table_meta.rs
index 740ed06..a225d50 100644
--- a/src/cassandra/schema/table_meta.rs
+++ b/src/cassandra/schema/table_meta.rs
@@ -1,21 +1,21 @@
-use cassandra::iterator::ColumnIterator;
-use cassandra::iterator::FieldIterator;
-
-use cassandra::schema::column_meta::ColumnMeta;
-use cassandra::util::Protected;
-use cassandra::value::Value;
-use cassandra_sys::CassTableMeta as _CassTableMeta;
-use cassandra_sys::cass_iterator_columns_from_table_meta;
-use cassandra_sys::cass_iterator_fields_from_table_meta;
-use cassandra_sys::cass_table_meta_clustering_key;
-use cassandra_sys::cass_table_meta_clustering_key_count;
-use cassandra_sys::cass_table_meta_column;
-use cassandra_sys::cass_table_meta_column_by_name;
-use cassandra_sys::cass_table_meta_column_count;
-use cassandra_sys::cass_table_meta_field_by_name;
-use cassandra_sys::cass_table_meta_name;
-use cassandra_sys::cass_table_meta_partition_key;
-use cassandra_sys::cass_table_meta_partition_key_count;
+use crate::cassandra::iterator::ColumnIterator;
+use crate::cassandra::iterator::FieldIterator;
+
+use crate::cassandra::schema::column_meta::ColumnMeta;
+use crate::cassandra::util::Protected;
+use crate::cassandra::value::Value;
+use crate::cassandra_sys::cass_iterator_columns_from_table_meta;
+use crate::cassandra_sys::cass_iterator_fields_from_table_meta;
+use crate::cassandra_sys::cass_table_meta_clustering_key;
+use crate::cassandra_sys::cass_table_meta_clustering_key_count;
+use crate::cassandra_sys::cass_table_meta_column;
+use crate::cassandra_sys::cass_table_meta_column_by_name;
+use crate::cassandra_sys::cass_table_meta_column_count;
+use crate::cassandra_sys::cass_table_meta_field_by_name;
+use crate::cassandra_sys::cass_table_meta_name;
+use crate::cassandra_sys::cass_table_meta_partition_key;
+use crate::cassandra_sys::cass_table_meta_partition_key_count;
+use crate::cassandra_sys::CassTableMeta as _CassTableMeta;
 use std::mem;
 use std::slice;
 
@@ -26,8 +26,15 @@ use std::str;
 pub struct TableMeta(*const _CassTableMeta);
 
 impl Protected<*const _CassTableMeta> for TableMeta {
-    fn inner(&self) -> *const _CassTableMeta { self.0 }
-    fn build(inner: *const _CassTableMeta) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; TableMeta(inner) }
+    fn inner(&self) -> *const _CassTableMeta {
+        self.0
+    }
+    fn build(inner: *const _CassTableMeta) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        TableMeta(inner)
+    }
 }
 
 impl TableMeta {
@@ -44,7 +51,12 @@ impl TableMeta {
     /// Gets the column metadata for the provided column name.
     pub fn column_by_name(&self, name: &str) -> ColumnMeta {
         // TODO: can return NULL
-        unsafe { ColumnMeta::build(cass_table_meta_column_by_name(self.0, name.as_ptr() as *const i8)) }
+        unsafe {
+            ColumnMeta::build(cass_table_meta_column_by_name(
+                self.0,
+                name.as_ptr() as *const i8,
+            ))
+        }
     }
 
     /// Gets the name of the table.
@@ -54,14 +66,19 @@ impl TableMeta {
             let mut name = mem::zeroed();
             let mut name_length = mem::zeroed();
             cass_table_meta_name(self.0, &mut name, &mut name_length);
-            str::from_utf8(slice::from_raw_parts(name as *const u8, name_length as usize))
-                .expect("must be utf8")
-                .to_owned()
+            str::from_utf8(slice::from_raw_parts(
+                name as *const u8,
+                name_length as usize,
+            ))
+            .expect("must be utf8")
+            .to_owned()
         }
     }
 
     /// Gets the total number of columns for the table.
-    pub fn column_count(&self) -> usize { unsafe { cass_table_meta_column_count(self.0) } }
+    pub fn column_count(&self) -> usize {
+        unsafe { cass_table_meta_column_count(self.0) }
+    }
 
     /// Gets the column metadata for the provided index.
     pub fn column(&self, index: usize) -> ColumnMeta {
@@ -70,7 +87,9 @@ impl TableMeta {
     }
 
     /// Gets the number of columns for the table's partition key.
-    pub fn partition_key_count(&self) -> usize { unsafe { cass_table_meta_partition_key_count(self.0) } }
+    pub fn partition_key_count(&self) -> usize {
+        unsafe { cass_table_meta_partition_key_count(self.0) }
+    }
 
     /// Gets the partition key column metadata for the provided index.
     pub fn partition_key(&self, index: usize) -> Option<ColumnMeta> {
@@ -85,7 +104,9 @@ impl TableMeta {
     }
 
     /// Gets the number of columns for the table's clustering key
-    pub fn clustering_key_count(&self) -> usize { unsafe { cass_table_meta_clustering_key_count(self.0) } }
+    pub fn clustering_key_count(&self) -> usize {
+        unsafe { cass_table_meta_clustering_key_count(self.0) }
+    }
 
     /// Gets the clustering key column metadata for the provided index.
     pub fn cluster_key(&self, index: usize) -> Option<ColumnMeta> {
@@ -99,7 +120,6 @@ impl TableMeta {
         }
     }
 
-
     /// Gets a metadata field for the provided name. Metadata fields allow direct
     /// access to the column data found in the underlying "tables" metadata table.
     pub fn field_by_name(&self, name: &str) -> Option<Value> {
@@ -111,7 +131,6 @@ impl TableMeta {
             } else {
                 Some(Value::build(value))
             }
-
         }
     }
 }
diff --git a/src/cassandra/session.rs b/src/cassandra/session.rs
index bc7ff9c..36404b7 100644
--- a/src/cassandra/session.rs
+++ b/src/cassandra/session.rs
@@ -2,28 +2,28 @@
 #![allow(dead_code)]
 #![allow(missing_copy_implementations)]
 
-use cassandra::batch::Batch;
-use cassandra::cluster::Cluster;
-use cassandra::result::CassResult;
-use cassandra::future::CassFuture;
-use cassandra::metrics::SessionMetrics;
-use cassandra::schema::schema_meta::SchemaMeta;
-use cassandra::statement::Statement;
-use cassandra::prepared::PreparedStatement;
-use cassandra::util::Protected;
-use cassandra::error::*;
-
-use cassandra_sys::CassSession as _Session;
-use cassandra_sys::cass_session_close;
-use cassandra_sys::cass_session_connect;
-use cassandra_sys::cass_session_connect_keyspace;
-use cassandra_sys::cass_session_execute;
-use cassandra_sys::cass_session_execute_batch;
-use cassandra_sys::cass_session_free;
-use cassandra_sys::cass_session_get_metrics;
-use cassandra_sys::cass_session_get_schema_meta;
-use cassandra_sys::cass_session_new;
-use cassandra_sys::cass_session_prepare;
+use crate::cassandra::batch::Batch;
+use crate::cassandra::cluster::Cluster;
+use crate::cassandra::error::*;
+use crate::cassandra::future::CassFuture;
+use crate::cassandra::metrics::SessionMetrics;
+use crate::cassandra::prepared::PreparedStatement;
+use crate::cassandra::result::CassResult;
+use crate::cassandra::schema::schema_meta::SchemaMeta;
+use crate::cassandra::statement::Statement;
+use crate::cassandra::util::Protected;
+
+use crate::cassandra_sys::cass_session_close;
+use crate::cassandra_sys::cass_session_connect;
+use crate::cassandra_sys::cass_session_connect_keyspace;
+use crate::cassandra_sys::cass_session_execute;
+use crate::cassandra_sys::cass_session_execute_batch;
+use crate::cassandra_sys::cass_session_free;
+use crate::cassandra_sys::cass_session_get_metrics;
+use crate::cassandra_sys::cass_session_get_schema_meta;
+use crate::cassandra_sys::cass_session_new;
+use crate::cassandra_sys::cass_session_prepare;
+use crate::cassandra_sys::CassSession as _Session;
 
 use std::ffi::CString;
 use std::ffi::NulError;
@@ -44,8 +44,15 @@ unsafe impl Send for Session {}
 unsafe impl Sync for Session {}
 
 impl Protected<*mut _Session> for Session {
-    fn inner(&self) -> *mut _Session { self.0 }
-    fn build(inner: *mut _Session) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Session(inner) }
+    fn inner(&self) -> *mut _Session {
+        self.0
+    }
+    fn build(inner: *mut _Session) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Session(inner)
+    }
 }
 
 impl Drop for Session {
@@ -57,13 +64,17 @@ impl Drop for Session {
 }
 
 impl Default for Session {
-    fn default() -> Session { Session::new() }
+    fn default() -> Session {
+        Session::new()
+    }
 }
 
 impl Session {
     /// Create a new Cassanda session.
     /// It's recommended to use Cluster.connect() instead
-    pub fn new() -> Session { unsafe { Session(cass_session_new()) } }
+    pub fn new() -> Session {
+        unsafe { Session(cass_session_new()) }
+    }
 
     //    pub fn new2() -> *mut _Session {
     //        unsafe { cass_session_new() }
@@ -78,22 +89,28 @@ impl Session {
     pub fn connect_keyspace(&self, cluster: &Cluster, keyspace: &str) -> Result<CassFuture<()>> {
         unsafe {
             let keyspace_cstr = CString::new(keyspace)?;
-            Ok(<CassFuture<()>>::build(
-                cass_session_connect_keyspace(self.0, cluster.inner(), keyspace_cstr.as_ptr())))
+            Ok(<CassFuture<()>>::build(cass_session_connect_keyspace(
+                self.0,
+                cluster.inner(),
+                keyspace_cstr.as_ptr(),
+            )))
         }
     }
 
     /// Closes the session instance, outputs a close future which can
     /// be used to determine when the session has been terminated. This allows
     /// in-flight requests to finish.
-    pub fn close(self) -> CassFuture<()> { unsafe { <CassFuture<()>>::build(cass_session_close(self.0)) } }
+    pub fn close(self) -> CassFuture<()> {
+        unsafe { <CassFuture<()>>::build(cass_session_close(self.0)) }
+    }
 
     /// Create a prepared statement.
     pub fn prepare(&self, query: &str) -> Result<CassFuture<PreparedStatement>> {
         unsafe {
             let query_cstr = CString::new(query)?;
             Ok(<CassFuture<PreparedStatement>>::build(
-                cass_session_prepare(self.0, query_cstr.as_ptr())))
+                cass_session_prepare(self.0, query_cstr.as_ptr()),
+            ))
         }
     }
 
@@ -107,7 +124,9 @@ impl Session {
 
     /// Execute a batch statement.
     pub fn execute_batch(&self, batch: Batch) -> CassFuture<CassResult> {
-        <CassFuture<CassResult>>::build(unsafe { cass_session_execute_batch(self.0, batch.inner()) })
+        <CassFuture<CassResult>>::build(unsafe {
+            cass_session_execute_batch(self.0, batch.inner())
+        })
     }
 
     /// Execute a statement.
@@ -119,7 +138,9 @@ impl Session {
     /// snapshot of the schema metadata is not updated. This function
     /// must be called again to retrieve any schema changes since the
     /// previous call.
-    pub fn get_schema_meta(&self) -> SchemaMeta { unsafe { SchemaMeta::build(cass_session_get_schema_meta(self.0)) } }
+    pub fn get_schema_meta(&self) -> SchemaMeta {
+        unsafe { SchemaMeta::build(cass_session_get_schema_meta(self.0)) }
+    }
 
     /// Gets a copy of this session's performance/diagnostic metrics.
     pub fn get_metrics(&self) -> SessionMetrics {
diff --git a/src/cassandra/ssl.rs b/src/cassandra/ssl.rs
index ea044b7..111346f 100644
--- a/src/cassandra/ssl.rs
+++ b/src/cassandra/ssl.rs
@@ -1,14 +1,14 @@
-use cassandra::util::Protected;
-use cassandra::error::*;
+use crate::cassandra::error::*;
+use crate::cassandra::util::Protected;
 
-use cassandra_sys::CassSslVerifyFlags;
-use cassandra_sys::CassSsl as _Ssl;
-use cassandra_sys::cass_ssl_add_trusted_cert;
-use cassandra_sys::cass_ssl_free;
-use cassandra_sys::cass_ssl_new;
-use cassandra_sys::cass_ssl_set_cert;
-use cassandra_sys::cass_ssl_set_private_key;
-use cassandra_sys::cass_ssl_set_verify_flags;
+use crate::cassandra_sys::cass_ssl_add_trusted_cert;
+use crate::cassandra_sys::cass_ssl_free;
+use crate::cassandra_sys::cass_ssl_new;
+use crate::cassandra_sys::cass_ssl_set_cert;
+use crate::cassandra_sys::cass_ssl_set_private_key;
+use crate::cassandra_sys::cass_ssl_set_verify_flags;
+use crate::cassandra_sys::CassSsl as _Ssl;
+use crate::cassandra_sys::CassSslVerifyFlags;
 
 use std::ffi::CString;
 
@@ -47,19 +47,29 @@ pub struct Ssl(*mut _Ssl);
 unsafe impl Send for Ssl {}
 
 impl Protected<*mut _Ssl> for Ssl {
-    fn inner(&self) -> *mut _Ssl { self.0 }
-    fn build(inner: *mut _Ssl) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Ssl(inner) }
+    fn inner(&self) -> *mut _Ssl {
+        self.0
+    }
+    fn build(inner: *mut _Ssl) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Ssl(inner)
+    }
 }
 
-
 impl Drop for Ssl {
     /// Frees a SSL context instance.
-    fn drop(&mut self) { unsafe { cass_ssl_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_ssl_free(self.0) }
+    }
 }
 
 impl Default for Ssl {
     /// Creates a new SSL context.
-    fn default() -> Ssl { unsafe { Ssl(cass_ssl_new()) } }
+    fn default() -> Ssl {
+        unsafe { Ssl(cass_ssl_new()) }
+    }
 }
 
 impl Ssl {
@@ -68,8 +78,7 @@ impl Ssl {
     pub fn add_trusted_cert(&mut self, cert: &str) -> Result<&mut Self> {
         unsafe {
             let cert_cstr = CString::new(cert)?;
-            cass_ssl_add_trusted_cert(self.0, cert_cstr.as_ptr())
-                .to_result(self)
+            cass_ssl_add_trusted_cert(self.0, cert_cstr.as_ptr()).to_result(self)
         }
     }
 
@@ -84,7 +93,9 @@ impl Ssl {
     /// certificate is also present.
     ///
     /// <b>Default:</b> CASS_SSL_VERIFY_PEER_CERT
-    pub fn set_verify_flags(&mut self, flags: &[SslVerifyFlag]) { unsafe { cass_ssl_set_verify_flags(self.0, to_bitset(flags)) } }
+    pub fn set_verify_flags(&mut self, flags: &[SslVerifyFlag]) {
+        unsafe { cass_ssl_set_verify_flags(self.0, to_bitset(flags)) }
+    }
 
     /// Set client-side certificate chain. This is used to authenticate
     /// the client on the server-side. This should contain the entire
@@ -92,8 +103,7 @@ impl Ssl {
     pub fn set_cert(&mut self, cert: &str) -> Result<&mut Self> {
         unsafe {
             let cert_cstr = CString::new(cert)?;
-            cass_ssl_set_cert(self.0, cert_cstr.as_ptr())
-                .to_result(self)
+            cass_ssl_set_cert(self.0, cert_cstr.as_ptr()).to_result(self)
         }
     }
 
@@ -102,9 +112,7 @@ impl Ssl {
     pub fn set_private_key(&mut self, key: &str, password: &str) -> Result<&mut Self> {
         unsafe {
             let key_cstr = CString::new(key)?;
-            cass_ssl_set_private_key(self.0,
-                                     key_cstr.as_ptr(),
-                                     password.as_ptr() as *const i8)
+            cass_ssl_set_private_key(self.0, key_cstr.as_ptr(), password.as_ptr() as *const i8)
                 .to_result(self)
         }
     }
diff --git a/src/cassandra/statement.rs b/src/cassandra/statement.rs
index b2aa288..dd62142 100644
--- a/src/cassandra/statement.rs
+++ b/src/cassandra/statement.rs
@@ -1,69 +1,69 @@
-use cassandra::batch::CustomPayload;
-use cassandra::collection::List;
-use cassandra::collection::Map;
+use crate::cassandra::batch::CustomPayload;
+use crate::cassandra::collection::List;
+use crate::cassandra::collection::Map;
 // use decimal::d128;
-use cassandra::collection::Set;
-use cassandra::consistency::Consistency;
-use cassandra::inet::Inet;
-use cassandra::policy::retry::RetryPolicy;
-use cassandra::result::CassResult;
-use cassandra::tuple::Tuple;
-use cassandra::user_type::UserType;
-use cassandra::util::Protected;
-use cassandra::uuid::Uuid;
-use cassandra::error::*;
-
-use cassandra_sys::CassStatement as _Statement;
-use cassandra_sys::cass_false;
-use cassandra_sys::cass_statement_add_key_index;
-use cassandra_sys::cass_statement_bind_bool;
-use cassandra_sys::cass_statement_bind_bool_by_name;
-use cassandra_sys::cass_statement_bind_bytes;
-use cassandra_sys::cass_statement_bind_bytes_by_name;
-use cassandra_sys::cass_statement_bind_collection;
-use cassandra_sys::cass_statement_bind_collection_by_name;
-use cassandra_sys::cass_statement_bind_decimal;
-use cassandra_sys::cass_statement_bind_decimal_by_name;
-use cassandra_sys::cass_statement_bind_double;
-use cassandra_sys::cass_statement_bind_double_by_name;
-use cassandra_sys::cass_statement_bind_float;
-use cassandra_sys::cass_statement_bind_float_by_name;
-use cassandra_sys::cass_statement_bind_inet;
-use cassandra_sys::cass_statement_bind_inet_by_name;
-use cassandra_sys::cass_statement_bind_int16;
-use cassandra_sys::cass_statement_bind_int16_by_name;
-use cassandra_sys::cass_statement_bind_int32;
-use cassandra_sys::cass_statement_bind_int32_by_name;
-use cassandra_sys::cass_statement_bind_int64;
-use cassandra_sys::cass_statement_bind_int64_by_name;
-use cassandra_sys::cass_statement_bind_int8;
-use cassandra_sys::cass_statement_bind_int8_by_name;
-use cassandra_sys::cass_statement_bind_null;
-use cassandra_sys::cass_statement_bind_null_by_name;
-use cassandra_sys::cass_statement_bind_string;
-use cassandra_sys::cass_statement_bind_string_by_name;
-use cassandra_sys::cass_statement_bind_tuple;
-use cassandra_sys::cass_statement_bind_tuple_by_name;
-use cassandra_sys::cass_statement_bind_uint32;
-use cassandra_sys::cass_statement_bind_uint32_by_name;
-use cassandra_sys::cass_statement_bind_user_type;
-use cassandra_sys::cass_statement_bind_user_type_by_name;
-use cassandra_sys::cass_statement_bind_uuid;
-use cassandra_sys::cass_statement_bind_uuid_by_name;
-use cassandra_sys::cass_statement_free;
-use cassandra_sys::cass_statement_new;
-use cassandra_sys::cass_statement_set_consistency;
-use cassandra_sys::cass_statement_set_custom_payload;
-use cassandra_sys::cass_statement_set_keyspace;
-use cassandra_sys::cass_statement_set_paging_size;
-use cassandra_sys::cass_statement_set_paging_state;
-use cassandra_sys::cass_statement_set_paging_state_token;
-use cassandra_sys::cass_statement_set_retry_policy;
-use cassandra_sys::cass_statement_set_serial_consistency;
-use cassandra_sys::cass_statement_set_timestamp;
-use cassandra_sys::cass_statement_set_request_timeout;
-use cassandra_sys::cass_true;
-use cassandra_sys::CASS_UINT64_MAX;
+use crate::cassandra::collection::Set;
+use crate::cassandra::consistency::Consistency;
+use crate::cassandra::error::*;
+use crate::cassandra::inet::Inet;
+use crate::cassandra::policy::retry::RetryPolicy;
+use crate::cassandra::result::CassResult;
+use crate::cassandra::tuple::Tuple;
+use crate::cassandra::user_type::UserType;
+use crate::cassandra::util::Protected;
+use crate::cassandra::uuid::Uuid;
+
+use crate::cassandra_sys::cass_false;
+use crate::cassandra_sys::cass_statement_add_key_index;
+use crate::cassandra_sys::cass_statement_bind_bool;
+use crate::cassandra_sys::cass_statement_bind_bool_by_name;
+use crate::cassandra_sys::cass_statement_bind_bytes;
+use crate::cassandra_sys::cass_statement_bind_bytes_by_name;
+use crate::cassandra_sys::cass_statement_bind_collection;
+use crate::cassandra_sys::cass_statement_bind_collection_by_name;
+use crate::cassandra_sys::cass_statement_bind_decimal;
+use crate::cassandra_sys::cass_statement_bind_decimal_by_name;
+use crate::cassandra_sys::cass_statement_bind_double;
+use crate::cassandra_sys::cass_statement_bind_double_by_name;
+use crate::cassandra_sys::cass_statement_bind_float;
+use crate::cassandra_sys::cass_statement_bind_float_by_name;
+use crate::cassandra_sys::cass_statement_bind_inet;
+use crate::cassandra_sys::cass_statement_bind_inet_by_name;
+use crate::cassandra_sys::cass_statement_bind_int16;
+use crate::cassandra_sys::cass_statement_bind_int16_by_name;
+use crate::cassandra_sys::cass_statement_bind_int32;
+use crate::cassandra_sys::cass_statement_bind_int32_by_name;
+use crate::cassandra_sys::cass_statement_bind_int64;
+use crate::cassandra_sys::cass_statement_bind_int64_by_name;
+use crate::cassandra_sys::cass_statement_bind_int8;
+use crate::cassandra_sys::cass_statement_bind_int8_by_name;
+use crate::cassandra_sys::cass_statement_bind_null;
+use crate::cassandra_sys::cass_statement_bind_null_by_name;
+use crate::cassandra_sys::cass_statement_bind_string;
+use crate::cassandra_sys::cass_statement_bind_string_by_name;
+use crate::cassandra_sys::cass_statement_bind_tuple;
+use crate::cassandra_sys::cass_statement_bind_tuple_by_name;
+use crate::cassandra_sys::cass_statement_bind_uint32;
+use crate::cassandra_sys::cass_statement_bind_uint32_by_name;
+use crate::cassandra_sys::cass_statement_bind_user_type;
+use crate::cassandra_sys::cass_statement_bind_user_type_by_name;
+use crate::cassandra_sys::cass_statement_bind_uuid;
+use crate::cassandra_sys::cass_statement_bind_uuid_by_name;
+use crate::cassandra_sys::cass_statement_free;
+use crate::cassandra_sys::cass_statement_new;
+use crate::cassandra_sys::cass_statement_set_consistency;
+use crate::cassandra_sys::cass_statement_set_custom_payload;
+use crate::cassandra_sys::cass_statement_set_keyspace;
+use crate::cassandra_sys::cass_statement_set_paging_size;
+use crate::cassandra_sys::cass_statement_set_paging_state;
+use crate::cassandra_sys::cass_statement_set_paging_state_token;
+use crate::cassandra_sys::cass_statement_set_request_timeout;
+use crate::cassandra_sys::cass_statement_set_retry_policy;
+use crate::cassandra_sys::cass_statement_set_serial_consistency;
+use crate::cassandra_sys::cass_statement_set_timestamp;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::CassStatement as _Statement;
+use crate::cassandra_sys::CASS_UINT64_MAX;
 
 use std::ffi::CString;
 use time::Duration;
@@ -81,8 +81,15 @@ pub struct Statement(*mut _Statement);
 unsafe impl Send for Statement {}
 
 impl Protected<*mut _Statement> for Statement {
-    fn inner(&self) -> *mut _Statement { self.0 }
-    fn build(inner: *mut _Statement) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Statement(inner) }
+    fn inner(&self) -> *mut _Statement {
+        self.0
+    }
+    fn build(inner: *mut _Statement) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Statement(inner)
+    }
 }
 
 #[macro_export]
@@ -109,11 +116,12 @@ macro_rules! stmt {
 //  i as i32 * 10,
 //  i as i64 * 100);
 
-
 impl Drop for Statement {
     /// Frees a statement instance. Statements can be immediately freed after
     /// being prepared, executed or added to a batch.
-    fn drop(&mut self) { unsafe { self.free() } }
+    fn drop(&mut self) {
+        unsafe { self.free() }
+    }
 }
 
 /// All Rust types that can be bound to a cassandra statement
@@ -130,105 +138,173 @@ pub trait BindRustType<T> {
 }
 
 impl BindRustType<bool> for Statement {
-    fn bind(&mut self, index: usize, value: bool) -> Result<&mut Self> { self.bind_bool(index, value) }
+    fn bind(&mut self, index: usize, value: bool) -> Result<&mut Self> {
+        self.bind_bool(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: bool) -> Result<&mut Self> { self.bind_bool_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: bool) -> Result<&mut Self> {
+        self.bind_bool_by_name(col, value)
+    }
 }
 
 impl BindRustType<f32> for Statement {
-    fn bind(&mut self, index: usize, value: f32) -> Result<&mut Self> { self.bind_float(index, value) }
+    fn bind(&mut self, index: usize, value: f32) -> Result<&mut Self> {
+        self.bind_float(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: f32) -> Result<&mut Self> { self.bind_float_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: f32) -> Result<&mut Self> {
+        self.bind_float_by_name(col, value)
+    }
 }
 
 impl BindRustType<f64> for Statement {
-    fn bind(&mut self, index: usize, value: f64) -> Result<&mut Self> { self.bind_double(index, value) }
+    fn bind(&mut self, index: usize, value: f64) -> Result<&mut Self> {
+        self.bind_double(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: f64) -> Result<&mut Self> { self.bind_double_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: f64) -> Result<&mut Self> {
+        self.bind_double_by_name(col, value)
+    }
 }
 
 impl BindRustType<i8> for Statement {
-    fn bind(&mut self, index: usize, value: i8) -> Result<&mut Self> { self.bind_int8(index, value) }
+    fn bind(&mut self, index: usize, value: i8) -> Result<&mut Self> {
+        self.bind_int8(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: i8) -> Result<&mut Self> { self.bind_int8_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: i8) -> Result<&mut Self> {
+        self.bind_int8_by_name(col, value)
+    }
 }
 
 impl BindRustType<i16> for Statement {
-    fn bind(&mut self, index: usize, value: i16) -> Result<&mut Self> { self.bind_int16(index, value) }
+    fn bind(&mut self, index: usize, value: i16) -> Result<&mut Self> {
+        self.bind_int16(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: i16) -> Result<&mut Self> { self.bind_int16_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: i16) -> Result<&mut Self> {
+        self.bind_int16_by_name(col, value)
+    }
 }
 
 impl BindRustType<i32> for Statement {
-    fn bind(&mut self, index: usize, value: i32) -> Result<&mut Self> { self.bind_int32(index, value) }
+    fn bind(&mut self, index: usize, value: i32) -> Result<&mut Self> {
+        self.bind_int32(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: i32) -> Result<&mut Self> { self.bind_int32_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: i32) -> Result<&mut Self> {
+        self.bind_int32_by_name(col, value)
+    }
 }
 
 impl BindRustType<i64> for Statement {
-    fn bind(&mut self, index: usize, value: i64) -> Result<&mut Self> { self.bind_int64(index, value) }
+    fn bind(&mut self, index: usize, value: i64) -> Result<&mut Self> {
+        self.bind_int64(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: i64) -> Result<&mut Self> { self.bind_int64_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: i64) -> Result<&mut Self> {
+        self.bind_int64_by_name(col, value)
+    }
 }
 
 impl BindRustType<u32> for Statement {
-    fn bind(&mut self, index: usize, value: u32) -> Result<&mut Self> { self.bind_uint32(index, value) }
+    fn bind(&mut self, index: usize, value: u32) -> Result<&mut Self> {
+        self.bind_uint32(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: u32) -> Result<&mut Self> { self.bind_uint32_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: u32) -> Result<&mut Self> {
+        self.bind_uint32_by_name(col, value)
+    }
 }
 
 impl<'a> BindRustType<&'a str> for Statement {
-    fn bind(&mut self, index: usize, value: &str) -> Result<&mut Self> { self.bind_string(index, value) }
+    fn bind(&mut self, index: usize, value: &str) -> Result<&mut Self> {
+        self.bind_string(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: &str) -> Result<&mut Self> { self.bind_string_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: &str) -> Result<&mut Self> {
+        self.bind_string_by_name(col, value)
+    }
 }
 
 impl BindRustType<Set> for Statement {
-    fn bind(&mut self, index: usize, value: Set) -> Result<&mut Self> { self.bind_set(index, value) }
+    fn bind(&mut self, index: usize, value: Set) -> Result<&mut Self> {
+        self.bind_set(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: Set) -> Result<&mut Self> { self.bind_set_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: Set) -> Result<&mut Self> {
+        self.bind_set_by_name(col, value)
+    }
 }
 
 impl BindRustType<List> for Statement {
-    fn bind(&mut self, index: usize, value: List) -> Result<&mut Self> { self.bind_list(index, value) }
+    fn bind(&mut self, index: usize, value: List) -> Result<&mut Self> {
+        self.bind_list(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: List) -> Result<&mut Self> { self.bind_list_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: List) -> Result<&mut Self> {
+        self.bind_list_by_name(col, value)
+    }
 }
 
 impl BindRustType<Uuid> for Statement {
-    fn bind(&mut self, index: usize, value: Uuid) -> Result<&mut Self> { self.bind_uuid(index, value) }
+    fn bind(&mut self, index: usize, value: Uuid) -> Result<&mut Self> {
+        self.bind_uuid(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: Uuid) -> Result<&mut Self> { self.bind_uuid_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: Uuid) -> Result<&mut Self> {
+        self.bind_uuid_by_name(col, value)
+    }
 }
 
 impl BindRustType<Inet> for Statement {
-    fn bind(&mut self, index: usize, value: Inet) -> Result<&mut Self> { self.bind_inet(index, value) }
+    fn bind(&mut self, index: usize, value: Inet) -> Result<&mut Self> {
+        self.bind_inet(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: Inet) -> Result<&mut Self> { self.bind_inet_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: Inet) -> Result<&mut Self> {
+        self.bind_inet_by_name(col, value)
+    }
 }
 
 impl BindRustType<Map> for Statement {
-    fn bind(&mut self, index: usize, value: Map) -> Result<&mut Self> { self.bind_map(index, value) }
+    fn bind(&mut self, index: usize, value: Map) -> Result<&mut Self> {
+        self.bind_map(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: Map) -> Result<&mut Self> { self.bind_map_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: Map) -> Result<&mut Self> {
+        self.bind_map_by_name(col, value)
+    }
 }
 
 impl BindRustType<Tuple> for Statement {
-    fn bind(&mut self, index: usize, value: Tuple) -> Result<&mut Self> { self.bind_tuple(index, value) }
+    fn bind(&mut self, index: usize, value: Tuple) -> Result<&mut Self> {
+        self.bind_tuple(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: Tuple) -> Result<&mut Self> { self.bind_tuple_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: Tuple) -> Result<&mut Self> {
+        self.bind_tuple_by_name(col, value)
+    }
 }
 
 impl BindRustType<&UserType> for Statement {
-    fn bind(&mut self, index: usize, value: &UserType) -> Result<&mut Self> { self.bind_user_type(index, value) }
+    fn bind(&mut self, index: usize, value: &UserType) -> Result<&mut Self> {
+        self.bind_user_type(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: &UserType) -> Result<&mut Self> { self.bind_user_type_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: &UserType) -> Result<&mut Self> {
+        self.bind_user_type_by_name(col, value)
+    }
 }
 
 impl BindRustType<Vec<u8>> for Statement {
-    fn bind(&mut self, index: usize, value: Vec<u8>) -> Result<&mut Self> { self.bind_bytes(index, value) }
+    fn bind(&mut self, index: usize, value: Vec<u8>) -> Result<&mut Self> {
+        self.bind_bytes(index, value)
+    }
 
-    fn bind_by_name(&mut self, col: &str, value: Vec<u8>) -> Result<&mut Self> { self.bind_bytes_by_name(col, value) }
+    fn bind_by_name(&mut self, col: &str, value: Vec<u8>) -> Result<&mut Self> {
+        self.bind_bytes_by_name(col, value)
+    }
 }
 
 impl Statement {
@@ -236,12 +312,13 @@ impl Statement {
     pub fn new(query: &str, parameter_count: usize) -> Self {
         unsafe {
             let query_cstr = CString::new(query).expect("must be utf8");
-            Statement(cass_statement_new(query_cstr.as_ptr(),
-                                         parameter_count))
+            Statement(cass_statement_new(query_cstr.as_ptr(), parameter_count))
         }
     }
 
-    unsafe fn free(&mut self) { cass_statement_free(self.0) }
+    unsafe fn free(&mut self) {
+        cass_statement_free(self.0)
+    }
 
     //    ///Binds an arbitrary CassBindable type to a cassandra statement
     //    ///FIXME not yet implemented
@@ -270,9 +347,7 @@ impl Statement {
     pub fn set_keyspace(&mut self, keyspace: String) -> Result<&mut Self> {
         unsafe {
             let keyspace_cstr = CString::new(keyspace)?;
-            cass_statement_set_keyspace(self.0,
-                                        keyspace_cstr.as_ptr())
-                .to_result(self)
+            cass_statement_set_keyspace(self.0, keyspace_cstr.as_ptr()).to_result(self)
         }
     }
 
@@ -280,10 +355,7 @@ impl Statement {
     ///
     /// <b>Default:</b> CASS_CONSISTENCY_LOCAL_ONE
     pub fn set_consistency(&mut self, consistency: Consistency) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_set_consistency(self.0, consistency.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_set_consistency(self.0, consistency.inner()).to_result(self) }
     }
 
     /// Sets the statement's serial consistency level.
@@ -317,19 +389,18 @@ impl Statement {
     /// used to gain access to other data.
     pub fn set_paging_state_token(&mut self, paging_state: &str) -> Result<&mut Self> {
         unsafe {
-            cass_statement_set_paging_state_token(self.0,
-                                                  paging_state.as_ptr() as *const i8,
-                                                  paging_state.len())
-                .to_result(self)
+            cass_statement_set_paging_state_token(
+                self.0,
+                paging_state.as_ptr() as *const i8,
+                paging_state.len(),
+            )
+            .to_result(self)
         }
     }
 
     /// Sets the statement's timestamp.
     pub fn set_timestamp(&mut self, timestamp: i64) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_set_timestamp(self.0, timestamp)
-                .to_result(self)
-        }
+        unsafe { cass_statement_set_timestamp(self.0, timestamp).to_result(self) }
     }
 
     /// Sets the statement's timeout for waiting for a response from a node.
@@ -348,26 +419,17 @@ impl Statement {
 
     /// Sets the statement's retry policy.
     pub fn set_retry_policy(&mut self, retry_policy: RetryPolicy) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_set_retry_policy(self.0, retry_policy.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_set_retry_policy(self.0, retry_policy.inner()).to_result(self) }
     }
 
     /// Sets the statement's custom payload.
     pub fn set_custom_payload(&mut self, payload: CustomPayload) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_set_custom_payload(self.0, payload.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_set_custom_payload(self.0, payload.inner()).to_result(self) }
     }
 
     /// Binds null to a query or bound statement at the specified index.
     pub fn bind_null(&mut self, index: usize) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_null(self.0, index)
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_null(self.0, index).to_result(self) }
     }
 
     /// Binds a null to all the values with the specified name.
@@ -377,74 +439,52 @@ impl Statement {
     pub fn bind_null_by_name(&mut self, name: &str) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_null_by_name(self.0, name_cstr.as_ptr())
-                .to_result(self)
+            cass_statement_bind_null_by_name(self.0, name_cstr.as_ptr()).to_result(self)
         }
     }
 
     /// Binds a "tinyint" to a query or bound statement at the specified index.
     pub fn bind_int8(&mut self, index: usize, value: i8) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_int8(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_int8(self.0, index, value).to_result(self) }
     }
 
     /// Binds a "tinyint" to all the values with the specified name.
     pub fn bind_int8_by_name(&mut self, name: &str, value: i8) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_int8_by_name(self.0,
-                                             name_cstr.as_ptr(),
-                                             value)
-                .to_result(self)
+            cass_statement_bind_int8_by_name(self.0, name_cstr.as_ptr(), value).to_result(self)
         }
     }
 
     /// Binds an "smallint" to a query or bound statement at the specified index.
     pub fn bind_int16(&mut self, index: usize, value: i16) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_int16(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_int16(self.0, index, value).to_result(self) }
     }
 
     /// Binds a "smallint" to all the values with the specified name.
     pub fn bind_int16_by_name(&mut self, name: &str, value: i16) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_int16_by_name(self.0,
-                                              name_cstr.as_ptr(),
-                                              value)
-                .to_result(self)
+            cass_statement_bind_int16_by_name(self.0, name_cstr.as_ptr(), value).to_result(self)
         }
     }
 
     /// Binds an "int" to a query or bound statement at the specified index.
     pub fn bind_int32(&mut self, index: usize, value: i32) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_int32(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_int32(self.0, index, value).to_result(self) }
     }
 
     /// Binds an "int" to all the values with the specified name.
     pub fn bind_int32_by_name(&mut self, name: &str, value: i32) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_int32_by_name(self.0,
-                                              name_cstr.as_ptr(),
-                                              value)
-                .to_result(self)
+            cass_statement_bind_int32_by_name(self.0, name_cstr.as_ptr(), value).to_result(self)
         }
     }
 
     /// Binds a "date" to a query or bound statement at the specified index.
     pub fn bind_uint32(&mut self, index: usize, value: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_uint32(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_uint32(self.0, index, value).to_result(self) }
     }
 
     /// Binds a "date" to all the values with the specified name.
@@ -454,20 +494,14 @@ impl Statement {
     pub fn bind_uint32_by_name(&mut self, name: &str, value: u32) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_uint32_by_name(self.0,
-                                               name_cstr.as_ptr(),
-                                               value)
-                .to_result(self)
+            cass_statement_bind_uint32_by_name(self.0, name_cstr.as_ptr(), value).to_result(self)
         }
     }
 
     /// Binds a "bigint", "counter", "timestamp" or "time" to a query or
     /// bound statement at the specified index.
     pub fn bind_int64(&mut self, index: usize, value: i64) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_int64(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_int64(self.0, index, value).to_result(self) }
     }
 
     /// Binds a "bigint", "counter", "timestamp" or "time" to all values
@@ -475,19 +509,13 @@ impl Statement {
     pub fn bind_int64_by_name(&mut self, name: &str, value: i64) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_int64_by_name(self.0,
-                                              name_cstr.as_ptr(),
-                                              value)
-                .to_result(self)
+            cass_statement_bind_int64_by_name(self.0, name_cstr.as_ptr(), value).to_result(self)
         }
     }
 
     /// Binds a "float" to a query or bound statement at the specified index.
     pub fn bind_float(&mut self, index: usize, value: f32) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_float(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_float(self.0, index, value).to_result(self) }
     }
 
     /// Binds a "float" to all the values with the specified name.
@@ -497,19 +525,13 @@ impl Statement {
     pub fn bind_float_by_name(&mut self, name: &str, value: f32) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_float_by_name(self.0,
-                                              name_cstr.as_ptr(),
-                                              value)
-                .to_result(self)
+            cass_statement_bind_float_by_name(self.0, name_cstr.as_ptr(), value).to_result(self)
         }
     }
 
     /// Binds a "double" to a query or bound statement at the specified index.
     pub fn bind_double(&mut self, index: usize, value: f64) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_double(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_double(self.0, index, value).to_result(self) }
     }
 
     /// Binds a "double" to all the values with the specified name.
@@ -519,10 +541,7 @@ impl Statement {
     pub fn bind_double_by_name(&mut self, name: &str, value: f64) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_double_by_name(self.0,
-                                               name_cstr.as_ptr(),
-                                               value)
-                .to_result(self)
+            cass_statement_bind_double_by_name(self.0, name_cstr.as_ptr(), value).to_result(self)
         }
     }
 
@@ -541,10 +560,12 @@ impl Statement {
     pub fn bind_bool_by_name(&mut self, name: &str, value: bool) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_bool_by_name(self.0,
-                                             name_cstr.as_ptr(),
-                                             if value { cass_true } else { cass_false })
-                .to_result(self)
+            cass_statement_bind_bool_by_name(
+                self.0,
+                name_cstr.as_ptr(),
+                if value { cass_true } else { cass_false },
+            )
+            .to_result(self)
         }
     }
 
@@ -553,10 +574,7 @@ impl Statement {
     pub fn bind_string(&mut self, index: usize, value: &str) -> Result<&mut Self> {
         unsafe {
             let value_cstr = CString::new(value)?;
-            cass_statement_bind_string(self.0,
-                                       index,
-                                       value_cstr.as_ptr())
-                .to_result(self)
+            cass_statement_bind_string(self.0, index, value_cstr.as_ptr()).to_result(self)
         }
     }
 
@@ -569,19 +587,15 @@ impl Statement {
         unsafe {
             let name_cstr = CString::new(name)?;
             let value_cstr = CString::new(value)?;
-            cass_statement_bind_string_by_name(self.0,
-                                               name_cstr.as_ptr(),
-                                               value_cstr.as_ptr())
+            cass_statement_bind_string_by_name(self.0, name_cstr.as_ptr(), value_cstr.as_ptr())
                 .to_result(self)
-
         }
     }
 
     /// Binds a "blob", "varint" or "custom" to a query or bound statement at the specified index.
     pub fn bind_bytes(&mut self, index: usize, value: Vec<u8>) -> Result<&mut Self> {
         unsafe {
-            cass_statement_bind_bytes(self.0, index, value.as_ptr(), value.len())
-                .to_result(self)
+            cass_statement_bind_bytes(self.0, index, value.as_ptr(), value.len()).to_result(self)
         }
     }
 
@@ -593,20 +607,19 @@ impl Statement {
     pub fn bind_bytes_by_name(&mut self, name: &str, mut value: Vec<u8>) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_bytes_by_name(self.0,
-                                              name_cstr.as_ptr(),
-                                              value.as_mut_ptr(),
-                                              value.len())
-                .to_result(self)
+            cass_statement_bind_bytes_by_name(
+                self.0,
+                name_cstr.as_ptr(),
+                value.as_mut_ptr(),
+                value.len(),
+            )
+            .to_result(self)
         }
     }
 
     /// Binds a "uuid" or "timeuuid" to a query or bound statement at the specified index.
     pub fn bind_uuid(&mut self, index: usize, value: Uuid) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_uuid(self.0, index, value.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_uuid(self.0, index, value.inner()).to_result(self) }
     }
 
     /// Binds a "uuid" or "timeuuid" to all the values
@@ -617,33 +630,25 @@ impl Statement {
     pub fn bind_uuid_by_name(&mut self, name: &str, value: Uuid) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_uuid_by_name(self.0,
-                                             name_cstr.as_ptr(),
-                                             value.inner())
+            cass_statement_bind_uuid_by_name(self.0, name_cstr.as_ptr(), value.inner())
                 .to_result(self)
         }
     }
 
     /// Binds an "inet" to a query or bound statement at the specified index.
     pub fn bind_inet(&mut self, index: usize, value: Inet) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_inet(self.0, index, value.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_inet(self.0, index, value.inner()).to_result(self) }
     }
 
     /// Binds an "inet" to all the values with the specified name.
     pub fn bind_inet_by_name(&mut self, name: &str, value: Inet) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_inet_by_name(self.0,
-                                             name_cstr.as_ptr(),
-                                             value.inner())
+            cass_statement_bind_inet_by_name(self.0, name_cstr.as_ptr(), value.inner())
                 .to_result(self)
         }
     }
 
-
     //  ///Bind a "decimal" to a query or bound statement at the specified index.
     //    pub fn bind_decimal(&self,
     //                                index: i32,
@@ -682,10 +687,7 @@ impl Statement {
 
     /// Bind a "map" to a query or bound statement at the specified index.
     pub fn bind_map(&mut self, index: usize, map: Map) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_collection(self.0, index, map.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_collection(self.0, index, map.inner()).to_result(self) }
     }
 
     /// Bind a "map" to all the values with the
@@ -696,18 +698,13 @@ impl Statement {
     pub fn bind_map_by_name(&mut self, name: &str, map: Map) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_collection_by_name(self.0,
-                                                   name_cstr.as_ptr(),
-                                                   map.inner())
+            cass_statement_bind_collection_by_name(self.0, name_cstr.as_ptr(), map.inner())
                 .to_result(self)
         }
     }
     /// Bind a "set" to a query or bound statement at the specified index.
     pub fn bind_set(&mut self, index: usize, collection: Set) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_collection(self.0, index, collection.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_collection(self.0, index, collection.inner()).to_result(self) }
     }
 
     /// Bind a "set" to all the values with the
@@ -718,19 +715,14 @@ impl Statement {
     pub fn bind_set_by_name(&mut self, name: &str, collection: Set) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_collection_by_name(self.0,
-                                                   name_cstr.as_ptr(),
-                                                   collection.inner())
+            cass_statement_bind_collection_by_name(self.0, name_cstr.as_ptr(), collection.inner())
                 .to_result(self)
         }
     }
 
     /// Bind a "list" to a query or bound statement at the specified index.
     pub fn bind_list(&mut self, index: usize, collection: List) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_collection(self.0, index, collection.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_collection(self.0, index, collection.inner()).to_result(self) }
     }
 
     /// Bind a "list" to all the values with the
@@ -741,19 +733,14 @@ impl Statement {
     pub fn bind_list_by_name(&mut self, name: &str, collection: List) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_collection_by_name(self.0,
-                                                   name_cstr.as_ptr(),
-                                                   collection.inner())
+            cass_statement_bind_collection_by_name(self.0, name_cstr.as_ptr(), collection.inner())
                 .to_result(self)
         }
     }
 
     /// Bind a "tuple" to a query or bound statement at the specified index.
     pub fn bind_tuple(&mut self, index: usize, value: Tuple) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_tuple(self.0, index, value.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_tuple(self.0, index, value.inner()).to_result(self) }
     }
 
     /// Bind a "tuple" to all the values with the specified name.
@@ -763,9 +750,7 @@ impl Statement {
     pub fn bind_tuple_by_name(&mut self, name: &str, value: Tuple) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_tuple_by_name(self.0,
-                                              name_cstr.as_ptr(),
-                                              value.inner())
+            cass_statement_bind_tuple_by_name(self.0, name_cstr.as_ptr(), value.inner())
                 .to_result(self)
         }
     }
@@ -773,10 +758,7 @@ impl Statement {
     /// Bind a user defined type to a query or bound statement at the
     /// specified index.
     pub fn bind_user_type(&mut self, index: usize, value: &UserType) -> Result<&mut Self> {
-        unsafe {
-            cass_statement_bind_user_type(self.0, index, value.inner())
-                .to_result(self)
-        }
+        unsafe { cass_statement_bind_user_type(self.0, index, value.inner()).to_result(self) }
     }
 
     /// Bind a user defined type to a query or bound statement with the
@@ -784,9 +766,7 @@ impl Statement {
     pub fn bind_user_type_by_name(&mut self, name: &str, value: &UserType) -> Result<&mut Self> {
         unsafe {
             let name_cstr = CString::new(name)?;
-            cass_statement_bind_user_type_by_name(self.0,
-                                                  name_cstr.as_ptr(),
-                                                  value.inner())
+            cass_statement_bind_user_type_by_name(self.0, name_cstr.as_ptr(), value.inner())
                 .to_result(self)
         }
     }
diff --git a/src/cassandra/time.rs b/src/cassandra/time.rs
index 476c1be..a516359 100644
--- a/src/cassandra/time.rs
+++ b/src/cassandra/time.rs
@@ -1,10 +1,10 @@
-use cassandra::util::Protected;
+use crate::cassandra::util::Protected;
 
-use cassandra_sys::CassTimestampGen as _TimestampGen;
-use cassandra_sys::cass_time_from_epoch;
-use cassandra_sys::cass_timestamp_gen_free;
-use cassandra_sys::cass_timestamp_gen_monotonic_new;
-use cassandra_sys::cass_timestamp_gen_server_side_new;
+use crate::cassandra_sys::cass_time_from_epoch;
+use crate::cassandra_sys::cass_timestamp_gen_free;
+use crate::cassandra_sys::cass_timestamp_gen_monotonic_new;
+use crate::cassandra_sys::cass_timestamp_gen_server_side_new;
+use crate::cassandra_sys::CassTimestampGen as _TimestampGen;
 // use cassandra_sys::cass_date_from_epoch;
 // use cassandra_sys::cass_date_time_to_epoch;
 use time::Duration;
@@ -17,11 +17,17 @@ unsafe impl Send for TimestampGen {}
 unsafe impl Sync for TimestampGen {}
 
 impl Protected<*mut _TimestampGen> for TimestampGen {
-    fn inner(&self) -> *mut _TimestampGen { self.0 }
-    fn build(inner: *mut _TimestampGen) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; TimestampGen(inner) }
+    fn inner(&self) -> *mut _TimestampGen {
+        self.0
+    }
+    fn build(inner: *mut _TimestampGen) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        TimestampGen(inner)
+    }
 }
 
-
 // ///Cassandra representation of the number of days since epoch
 // pub struct Date(u32);
 
@@ -30,7 +36,6 @@ impl Protected<*mut _TimestampGen> for TimestampGen {
 #[derive(Debug)]
 pub struct Time(i64);
 
-
 impl TimestampGen {
     /// Converts a unix timestamp (in seconds) to the Cassandra "time" type. The "time" type
     /// represents the number of nanoseconds since midnight (range 0 to 86399999999999).
@@ -44,13 +49,17 @@ impl TimestampGen {
     /// for a given clock tick even if shared by multiple session objects. If that rate is
     /// exceeded then a warning is logged and timestamps stop incrementing until the next
     /// clock tick.
-    pub fn gen_monotonic_new() -> Self { unsafe { TimestampGen(cass_timestamp_gen_monotonic_new()) } }
+    pub fn gen_monotonic_new() -> Self {
+        unsafe { TimestampGen(cass_timestamp_gen_monotonic_new()) }
+    }
 
     /// Creates a new server-side timestamp generator. This generator allows Cassandra
     /// to assign timestamps server-side.
     ///
     /// <b>Note:</b> This is the default timestamp generator.
-    pub fn gen_server_side_new() -> Self { unsafe { TimestampGen(cass_timestamp_gen_server_side_new()) } }
+    pub fn gen_server_side_new() -> Self {
+        unsafe { TimestampGen(cass_timestamp_gen_server_side_new()) }
+    }
 
     //    pub fn from_epoch() -> Self {
     //        unsafe { TimestampGen(cass_timestamp_gen_monotonic_new()) }
@@ -70,5 +79,7 @@ impl TimestampGen {
 // }
 
 impl Drop for TimestampGen {
-    fn drop(&mut self) { unsafe { cass_timestamp_gen_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_timestamp_gen_free(self.0) }
+    }
 }
diff --git a/src/cassandra/tuple.rs b/src/cassandra/tuple.rs
index a690117..6d59e6d 100644
--- a/src/cassandra/tuple.rs
+++ b/src/cassandra/tuple.rs
@@ -1,36 +1,36 @@
-use cassandra::collection::Set;
-use cassandra::data_type::ConstDataType;
-use cassandra::data_type::DataType;
-use cassandra::inet::Inet;
-use cassandra::user_type::UserType;
-use cassandra::util::Protected;
-use cassandra::uuid::Uuid;
-use cassandra::error::*;
-
-use cassandra_sys::CassTuple as _Tuple;
-use cassandra_sys::cass_false;
-use cassandra_sys::cass_true;
-use cassandra_sys::cass_tuple_data_type;
-use cassandra_sys::cass_tuple_free;
-use cassandra_sys::cass_tuple_new;
-use cassandra_sys::cass_tuple_new_from_data_type;
-use cassandra_sys::cass_tuple_set_bool;
-use cassandra_sys::cass_tuple_set_bytes;
-use cassandra_sys::cass_tuple_set_collection;
-use cassandra_sys::cass_tuple_set_decimal;
-use cassandra_sys::cass_tuple_set_double;
-use cassandra_sys::cass_tuple_set_float;
-use cassandra_sys::cass_tuple_set_inet;
-use cassandra_sys::cass_tuple_set_int16;
-use cassandra_sys::cass_tuple_set_int32;
-use cassandra_sys::cass_tuple_set_int64;
-use cassandra_sys::cass_tuple_set_int8;
-use cassandra_sys::cass_tuple_set_null;
-use cassandra_sys::cass_tuple_set_string;
-use cassandra_sys::cass_tuple_set_tuple;
-use cassandra_sys::cass_tuple_set_uint32;
-use cassandra_sys::cass_tuple_set_user_type;
-use cassandra_sys::cass_tuple_set_uuid;
+use crate::cassandra::collection::Set;
+use crate::cassandra::data_type::ConstDataType;
+use crate::cassandra::data_type::DataType;
+use crate::cassandra::error::*;
+use crate::cassandra::inet::Inet;
+use crate::cassandra::user_type::UserType;
+use crate::cassandra::util::Protected;
+use crate::cassandra::uuid::Uuid;
+
+use crate::cassandra_sys::cass_false;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::cass_tuple_data_type;
+use crate::cassandra_sys::cass_tuple_free;
+use crate::cassandra_sys::cass_tuple_new;
+use crate::cassandra_sys::cass_tuple_new_from_data_type;
+use crate::cassandra_sys::cass_tuple_set_bool;
+use crate::cassandra_sys::cass_tuple_set_bytes;
+use crate::cassandra_sys::cass_tuple_set_collection;
+use crate::cassandra_sys::cass_tuple_set_decimal;
+use crate::cassandra_sys::cass_tuple_set_double;
+use crate::cassandra_sys::cass_tuple_set_float;
+use crate::cassandra_sys::cass_tuple_set_inet;
+use crate::cassandra_sys::cass_tuple_set_int16;
+use crate::cassandra_sys::cass_tuple_set_int32;
+use crate::cassandra_sys::cass_tuple_set_int64;
+use crate::cassandra_sys::cass_tuple_set_int8;
+use crate::cassandra_sys::cass_tuple_set_null;
+use crate::cassandra_sys::cass_tuple_set_string;
+use crate::cassandra_sys::cass_tuple_set_tuple;
+use crate::cassandra_sys::cass_tuple_set_uint32;
+use crate::cassandra_sys::cass_tuple_set_user_type;
+use crate::cassandra_sys::cass_tuple_set_uuid;
+use crate::cassandra_sys::CassTuple as _Tuple;
 
 use std::ffi::CString;
 use std::net::IpAddr;
@@ -44,13 +44,22 @@ pub struct Tuple(*mut _Tuple);
 unsafe impl Send for Tuple {}
 
 impl Protected<*mut _Tuple> for Tuple {
-    fn inner(&self) -> *mut _Tuple { self.0 }
-    fn build(inner: *mut _Tuple) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Tuple(inner) }
+    fn inner(&self) -> *mut _Tuple {
+        self.0
+    }
+    fn build(inner: *mut _Tuple) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Tuple(inner)
+    }
 }
 
 impl Tuple {
     /// Creates a new tuple.
-    pub fn new(item_count: usize) -> Self { unsafe { Tuple(cass_tuple_new(item_count)) } }
+    pub fn new(item_count: usize) -> Self {
+        unsafe { Tuple(cass_tuple_new(item_count)) }
+    }
 
     /// Creates a new tuple from an existing data type.
     pub fn new_from_data_type(data_type: DataType) -> Tuple {
@@ -58,71 +67,49 @@ impl Tuple {
     }
 
     /// Gets the data type of a tuple.
-    pub fn data_type(&mut self) -> ConstDataType { unsafe { ConstDataType::build(cass_tuple_data_type(self.0)) } }
+    pub fn data_type(&mut self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_tuple_data_type(self.0)) }
+    }
 
     /// Sets an null in a tuple at the specified index.
     pub fn set_null(&mut self, index: usize) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_null(self.0, index)
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_null(self.0, index).to_result(self) }
     }
 
     /// Sets a "tinyint" in a tuple at the specified index.
     pub fn set_int8(&mut self, index: usize, value: i8) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_int8(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_int8(self.0, index, value).to_result(self) }
     }
 
     /// Sets an "smallint" in a tuple at the specified index.
     pub fn set_int16(&mut self, index: usize, value: i16) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_int16(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_int16(self.0, index, value).to_result(self) }
     }
 
     /// Sets an "int" in a tuple at the specified index.
     pub fn set_int32(&mut self, index: usize, value: i32) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_int32(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_int32(self.0, index, value).to_result(self) }
     }
 
     /// Sets a "date" in a tuple at the specified index.
     pub fn set_uint32(&mut self, index: usize, value: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_uint32(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_uint32(self.0, index, value).to_result(self) }
     }
 
     /// Sets a "bigint", "counter", "timestamp" or "time" in a tuple at the
     /// specified index.
     pub fn set_int64(&mut self, index: usize, value: i64) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_int64(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_int64(self.0, index, value).to_result(self) }
     }
 
     /// Sets a "float" in a tuple at the specified index.
     pub fn set_float(&mut self, index: usize, value: f32) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_float(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_float(self.0, index, value).to_result(self) }
     }
 
     /// Sets a "double" in a tuple at the specified index.
     pub fn set_double(&mut self, index: usize, value: f64) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_double(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_double(self.0, index, value).to_result(self) }
     }
 
     /// Sets a "boolean" in a tuple at the specified index.
@@ -135,68 +122,55 @@ impl Tuple {
 
     /// Sets an "ascii", "text" or "varchar" in a tuple at the specified index.
     pub fn set_string<S>(&mut self, index: usize, value: S) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let value_cstr = CString::new(value.into())?;
-            cass_tuple_set_string(self.0,
-                                  index,
-                                  value_cstr.as_ptr())
-                .to_result(self)
+            cass_tuple_set_string(self.0, index, value_cstr.as_ptr()).to_result(self)
         }
     }
 
     /// Sets a "blob", "varint" or "custom" in a tuple at the specified index.
     pub fn set_bytes(&mut self, index: usize, value: Vec<u8>) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_bytes(self.0, index, value.as_ptr(), value.len())
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_bytes(self.0, index, value.as_ptr(), value.len()).to_result(self) }
     }
 
     /// Sets a "uuid" or "timeuuid" in a tuple at the specified index.
     pub fn set_uuid<S>(&mut self, index: usize, value: S) -> Result<&mut Self>
-        where S: Into<Uuid> {
-        unsafe {
-            cass_tuple_set_uuid(self.0, index, value.into().inner())
-                .to_result(self)
-        }
+    where
+        S: Into<Uuid>,
+    {
+        unsafe { cass_tuple_set_uuid(self.0, index, value.into().inner()).to_result(self) }
     }
 
     /// Sets an "inet" in a tuple at the specified index.
     pub fn set_inet(&mut self, index: usize, value: IpAddr) -> Result<&mut Self> {
         let inet = Inet::from(&value);
-        unsafe {
-            cass_tuple_set_inet(self.0, index, inet.inner())
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_inet(self.0, index, inet.inner()).to_result(self) }
     }
 
     /// Sets a "list", "map" or "set" in a tuple at the specified index.
     pub fn set_collection<S>(&mut self, index: usize, value: S) -> Result<&mut Self>
-        where S: Into<Set> {
-        unsafe {
-            cass_tuple_set_collection(self.0, index, value.into().inner())
-                .to_result(self)
-        }
+    where
+        S: Into<Set>,
+    {
+        unsafe { cass_tuple_set_collection(self.0, index, value.into().inner()).to_result(self) }
     }
 
     /// Sets a "tuple" in a tuple at the specified index.
     pub fn set_tuple(&mut self, index: usize, value: Tuple) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_tuple(self.0, index, value.0)
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_tuple(self.0, index, value.0).to_result(self) }
     }
 
     /// Sets a "udt" in a tuple at the specified index.
     pub fn set_user_type(&mut self, index: usize, value: &UserType) -> Result<&mut Self> {
-        unsafe {
-            cass_tuple_set_user_type(self.0, index, value.inner())
-                .to_result(self)
-        }
+        unsafe { cass_tuple_set_user_type(self.0, index, value.inner()).to_result(self) }
     }
 }
 
 impl Drop for Tuple {
-    fn drop(&mut self) { unsafe { cass_tuple_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_tuple_free(self.0) }
+    }
 }
diff --git a/src/cassandra/user_type.rs b/src/cassandra/user_type.rs
index 0d84767..093a589 100644
--- a/src/cassandra/user_type.rs
+++ b/src/cassandra/user_type.rs
@@ -1,52 +1,50 @@
-
-
-use cassandra::collection::Set;
-use cassandra::data_type::ConstDataType;
-use cassandra::inet::Inet;
-use cassandra::tuple::Tuple;
-use cassandra::util::Protected;
-use cassandra::uuid::Uuid;
-use cassandra::error::*;
-
-use cassandra_sys::CassUserType as _UserType;
-use cassandra_sys::cass_false;
-use cassandra_sys::cass_true;
-use cassandra_sys::cass_user_type_data_type;
-use cassandra_sys::cass_user_type_free;
-use cassandra_sys::cass_user_type_set_bool;
-use cassandra_sys::cass_user_type_set_bool_by_name;
-use cassandra_sys::cass_user_type_set_bytes;
-use cassandra_sys::cass_user_type_set_bytes_by_name;
-use cassandra_sys::cass_user_type_set_collection;
-use cassandra_sys::cass_user_type_set_collection_by_name;
-use cassandra_sys::cass_user_type_set_decimal;
-use cassandra_sys::cass_user_type_set_decimal_by_name;
-use cassandra_sys::cass_user_type_set_double;
-use cassandra_sys::cass_user_type_set_double_by_name;
-use cassandra_sys::cass_user_type_set_float;
-use cassandra_sys::cass_user_type_set_float_by_name;
-use cassandra_sys::cass_user_type_set_inet;
-use cassandra_sys::cass_user_type_set_inet_by_name;
-use cassandra_sys::cass_user_type_set_int16;
-use cassandra_sys::cass_user_type_set_int16_by_name;
-use cassandra_sys::cass_user_type_set_int32;
-use cassandra_sys::cass_user_type_set_int32_by_name;
-use cassandra_sys::cass_user_type_set_int64;
-use cassandra_sys::cass_user_type_set_int64_by_name;
-use cassandra_sys::cass_user_type_set_int8;
-use cassandra_sys::cass_user_type_set_int8_by_name;
-use cassandra_sys::cass_user_type_set_null;
-use cassandra_sys::cass_user_type_set_null_by_name;
-use cassandra_sys::cass_user_type_set_string;
-use cassandra_sys::cass_user_type_set_string_by_name;
-use cassandra_sys::cass_user_type_set_tuple;
-use cassandra_sys::cass_user_type_set_tuple_by_name;
-use cassandra_sys::cass_user_type_set_uint32;
-use cassandra_sys::cass_user_type_set_uint32_by_name;
-use cassandra_sys::cass_user_type_set_user_type;
-use cassandra_sys::cass_user_type_set_user_type_by_name;
-use cassandra_sys::cass_user_type_set_uuid;
-use cassandra_sys::cass_user_type_set_uuid_by_name;
+use crate::cassandra::collection::Set;
+use crate::cassandra::data_type::ConstDataType;
+use crate::cassandra::error::*;
+use crate::cassandra::inet::Inet;
+use crate::cassandra::tuple::Tuple;
+use crate::cassandra::util::Protected;
+use crate::cassandra::uuid::Uuid;
+
+use crate::cassandra_sys::cass_false;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::cass_user_type_data_type;
+use crate::cassandra_sys::cass_user_type_free;
+use crate::cassandra_sys::cass_user_type_set_bool;
+use crate::cassandra_sys::cass_user_type_set_bool_by_name;
+use crate::cassandra_sys::cass_user_type_set_bytes;
+use crate::cassandra_sys::cass_user_type_set_bytes_by_name;
+use crate::cassandra_sys::cass_user_type_set_collection;
+use crate::cassandra_sys::cass_user_type_set_collection_by_name;
+use crate::cassandra_sys::cass_user_type_set_decimal;
+use crate::cassandra_sys::cass_user_type_set_decimal_by_name;
+use crate::cassandra_sys::cass_user_type_set_double;
+use crate::cassandra_sys::cass_user_type_set_double_by_name;
+use crate::cassandra_sys::cass_user_type_set_float;
+use crate::cassandra_sys::cass_user_type_set_float_by_name;
+use crate::cassandra_sys::cass_user_type_set_inet;
+use crate::cassandra_sys::cass_user_type_set_inet_by_name;
+use crate::cassandra_sys::cass_user_type_set_int16;
+use crate::cassandra_sys::cass_user_type_set_int16_by_name;
+use crate::cassandra_sys::cass_user_type_set_int32;
+use crate::cassandra_sys::cass_user_type_set_int32_by_name;
+use crate::cassandra_sys::cass_user_type_set_int64;
+use crate::cassandra_sys::cass_user_type_set_int64_by_name;
+use crate::cassandra_sys::cass_user_type_set_int8;
+use crate::cassandra_sys::cass_user_type_set_int8_by_name;
+use crate::cassandra_sys::cass_user_type_set_null;
+use crate::cassandra_sys::cass_user_type_set_null_by_name;
+use crate::cassandra_sys::cass_user_type_set_string;
+use crate::cassandra_sys::cass_user_type_set_string_by_name;
+use crate::cassandra_sys::cass_user_type_set_tuple;
+use crate::cassandra_sys::cass_user_type_set_tuple_by_name;
+use crate::cassandra_sys::cass_user_type_set_uint32;
+use crate::cassandra_sys::cass_user_type_set_uint32_by_name;
+use crate::cassandra_sys::cass_user_type_set_user_type;
+use crate::cassandra_sys::cass_user_type_set_user_type_by_name;
+use crate::cassandra_sys::cass_user_type_set_uuid;
+use crate::cassandra_sys::cass_user_type_set_uuid_by_name;
+use crate::cassandra_sys::CassUserType as _UserType;
 
 use std::ffi::CString;
 // use cassandra::iterator::FieldIterator;
@@ -60,13 +58,21 @@ pub struct UserType(*mut _UserType);
 unsafe impl Send for UserType {}
 
 impl Protected<*mut _UserType> for UserType {
-    fn inner(&self) -> *mut _UserType { self.0 }
-    fn build(inner: *mut _UserType) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; UserType(inner) }
+    fn inner(&self) -> *mut _UserType {
+        self.0
+    }
+    fn build(inner: *mut _UserType) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        UserType(inner)
+    }
 }
 
-
 impl Drop for UserType {
-    fn drop(&mut self) { unsafe { cass_user_type_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_user_type_free(self.0) }
+    }
 }
 
 // impl Drop for UserType {
@@ -77,113 +83,102 @@ impl Drop for UserType {
 
 impl UserType {
     /// Gets the data type of a user defined type.
-    pub fn data_type(&self) -> ConstDataType { unsafe { ConstDataType::build(cass_user_type_data_type(self.0)) } }
+    pub fn data_type(&self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_user_type_data_type(self.0)) }
+    }
 
     /// Sets a null in a user defined type at the specified index.
     pub fn set_null(&mut self, index: usize) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_null(self.0, index)
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_null(self.0, index).to_result(self) }
     }
 
     /// Sets a null in a user defined type at the specified name.
     pub fn set_null_by_name<S>(&mut self, name: S) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name_cstr = CString::new(name.into())?;
-            cass_user_type_set_null_by_name(self.0,
-                                            name_cstr.as_ptr())
-                .to_result(self)
+            cass_user_type_set_null_by_name(self.0, name_cstr.as_ptr()).to_result(self)
         }
     }
 
     /// Sets a "tinyint" in a user defined type at the specified index.
     pub fn set_int8(&mut self, index: usize, value: i8) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_int8(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_int8(self.0, index, value).to_result(self) }
     }
 
     /// Sets a "tinyint" in a user defined type at the specified name.
     pub fn set_int8_by_name<S>(&mut self, name: S, value: i8) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
-            cass_user_type_set_int8_by_name(self.0, name.as_ptr(), value)
-                .to_result(self)
+            cass_user_type_set_int8_by_name(self.0, name.as_ptr(), value).to_result(self)
         }
     }
 
     /// Sets an "smallint" in a user defined type at the specified index.
     pub fn set_int16(&mut self, index: usize, value: i16) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_int16(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_int16(self.0, index, value).to_result(self) }
     }
 
     /// Sets an "smallint" in a user defined type at the specified name.
     pub fn set_int16_by_name<S>(&mut self, name: S, value: i16) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
-            cass_user_type_set_int16_by_name(self.0, name.as_ptr(), value)
-                .to_result(self)
+            cass_user_type_set_int16_by_name(self.0, name.as_ptr(), value).to_result(self)
         }
     }
 
     /// Sets an "int" in a user defined type at the specified index.
     pub fn set_int32(&mut self, index: usize, value: i32) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_int32(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_int32(self.0, index, value).to_result(self) }
     }
 
     /// Sets an "int" in a user defined type at the specified name.
     pub fn set_int32_by_name<S>(&mut self, name: S, value: i32) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
-            cass_user_type_set_int32_by_name(self.0, name.as_ptr(), value)
-                .to_result(self)
+            cass_user_type_set_int32_by_name(self.0, name.as_ptr(), value).to_result(self)
         }
     }
 
     /// Sets a "date" in a user defined type at the specified index.
     pub fn set_uint32(&mut self, index: usize, value: u32) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_uint32(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_uint32(self.0, index, value).to_result(self) }
     }
 
     /// Sets a "date" in a user defined type at the specified name.
     pub fn set_uint32_by_name<S>(&mut self, name: S, value: u32) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
-            cass_user_type_set_uint32_by_name(self.0, name.as_ptr(), value)
-                .to_result(self)
+            cass_user_type_set_uint32_by_name(self.0, name.as_ptr(), value).to_result(self)
         }
     }
 
-
     /// Sets an "bigint", "counter", "timestamp" or "time" in a
     /// user defined type at the specified index.
     pub fn set_int64(&mut self, index: usize, value: i64) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_int64(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_int64(self.0, index, value).to_result(self) }
     }
 
     /// Sets an "bigint", "counter", "timestamp" or "time" in a
     /// user defined type at the specified name.
     pub fn set_int64_by_name<S>(&mut self, name: S, value: i64) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
             cass_user_type_set_int64_by_name(self.0, name.as_ptr(), value).to_result(self)
@@ -192,15 +187,14 @@ impl UserType {
 
     /// Sets a "float" in a user defined type at the specified index.
     pub fn set_float(&mut self, index: usize, value: f32) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_float(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_float(self.0, index, value).to_result(self) }
     }
 
     /// Sets a "float" in a user defined type at the specified name.
     pub fn set_float_by_name<S>(&mut self, name: S, value: f32) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
             cass_user_type_set_float_by_name(self.0, name.as_ptr(), value).to_result(self)
@@ -209,16 +203,15 @@ impl UserType {
 
     /// Sets an "double" in a user defined type at the specified index.
     pub fn set_double(&mut self, index: usize, value: f64) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_double(self.0, index, value)
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_double(self.0, index, value).to_result(self) }
     }
 
     /// Sets an "double" in a user defined type at the specified name.
 
     pub fn set_double_by_name<S>(&mut self, name: S, value: f64) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
             cass_user_type_set_double_by_name(self.0, name.as_ptr(), value).to_result(self)
@@ -235,20 +228,26 @@ impl UserType {
 
     /// Sets a "boolean" in a user defined type at the specified name.
     pub fn set_bool_by_name<S>(&mut self, name: S, value: bool) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
-            cass_user_type_set_bool_by_name(self.0,
-                                            name.as_ptr(),
-                                            if value { cass_true } else { cass_false })
-                .to_result(self)
+            cass_user_type_set_bool_by_name(
+                self.0,
+                name.as_ptr(),
+                if value { cass_true } else { cass_false },
+            )
+            .to_result(self)
         }
     }
 
     /// Sets an "ascii", "text" or "varchar" in a user defined type at the
     /// specified index.
     pub fn set_stringl<S>(&mut self, index: usize, value: S) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let value = CString::new(value.into())?;
             cass_user_type_set_string(self.0, index, value.as_ptr()).to_result(self)
@@ -258,12 +257,13 @@ impl UserType {
     /// Sets an "ascii", "text" or "varchar" in a user defined type at the
     /// specified name.
     pub fn set_string_by_name<S>(&mut self, name: S, value: S) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
             let value = CString::new(value.into())?;
-            cass_user_type_set_string_by_name(self.0, name.as_ptr(), value.as_ptr())
-                .to_result(self)
+            cass_user_type_set_string_by_name(self.0, name.as_ptr(), value.as_ptr()).to_result(self)
         }
     }
 
@@ -271,14 +271,15 @@ impl UserType {
     /// Sets a "blob" "varint" or "custom" in a user defined type at the specified index.
     pub fn set_bytes(&mut self, index: usize, value: Vec<u8>) -> Result<&mut Self> {
         unsafe {
-            cass_user_type_set_bytes(self.0, index, value.as_ptr(), value.len())
-                .to_result(self)
+            cass_user_type_set_bytes(self.0, index, value.as_ptr(), value.len()).to_result(self)
         }
     }
 
     /// Sets a "blob", "varint" or "custom" in a user defined type at the specified name.
     pub fn set_bytes_by_name<S>(&mut self, name: S, value: Vec<u8>) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
             cass_user_type_set_bytes_by_name(self.0, name.as_ptr(), value.as_ptr(), value.len())
@@ -288,16 +289,18 @@ impl UserType {
 
     /// Sets a "uuid" or "timeuuid" in a user defined type at the specified index.
     pub fn set_uuid<S>(&mut self, index: usize, value: S) -> Result<&mut Self>
-        where S: Into<Uuid> {
-        unsafe {
-            cass_user_type_set_uuid(self.0, index, value.into().inner())
-                .to_result(self)
-        }
+    where
+        S: Into<Uuid>,
+    {
+        unsafe { cass_user_type_set_uuid(self.0, index, value.into().inner()).to_result(self) }
     }
 
     /// Sets a "uuid" or "timeuuid" in a user defined type at the specified name.
     pub fn set_uuid_by_name<S, U>(&mut self, name: S, value: U) -> Result<&mut Self>
-        where S: Into<String>, U: Into<Uuid> {
+    where
+        S: Into<String>,
+        U: Into<Uuid>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
             cass_user_type_set_uuid_by_name(self.0, name.as_ptr(), value.into().inner())
@@ -307,16 +310,18 @@ impl UserType {
 
     /// Sets a "inet" in a user defined type at the specified index.
     pub fn set_inet<S>(&mut self, index: usize, value: S) -> Result<&mut Self>
-        where S: Into<Inet> {
-        unsafe {
-            cass_user_type_set_inet(self.0, index, value.into().inner())
-                .to_result(self)
-        }
+    where
+        S: Into<Inet>,
+    {
+        unsafe { cass_user_type_set_inet(self.0, index, value.into().inner()).to_result(self) }
     }
 
     /// Sets a "inet" in a user defined type at the specified name.
     pub fn set_inet_by_name<S, U>(&mut self, name: S, value: U) -> Result<&mut Self>
-        where S: Into<String>, U: Into<Inet> {
+    where
+        S: Into<String>,
+        U: Into<Inet>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
             cass_user_type_set_inet_by_name(self.0, name.as_ptr(), value.into().inner())
@@ -326,17 +331,20 @@ impl UserType {
 
     /// Sets a "list", "map" or "set" in a user defined type at the specified index.
     pub fn set_collection<S>(&mut self, index: usize, value: S) -> Result<&mut Self>
-        where S: Into<Set> {
+    where
+        S: Into<Set>,
+    {
         unsafe {
-            cass_user_type_set_collection(self.0, index, value.into().inner())
-                .to_result(self)
+            cass_user_type_set_collection(self.0, index, value.into().inner()).to_result(self)
         }
     }
 
     /// Sets a "list", "map" or "set" in a user defined type at the
     /// specified name.
     pub fn set_collection_by_name<S>(&mut self, name: S, value: Set) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
             cass_user_type_set_collection_by_name(self.0, name.as_ptr(), value.inner())
@@ -346,37 +354,33 @@ impl UserType {
 
     /// Sets a "tuple" in a user defined type at the specified index.
     pub fn set_tuple(&mut self, index: usize, value: Tuple) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_tuple(self.0, index, value.inner())
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_tuple(self.0, index, value.inner()).to_result(self) }
     }
 
     /// Sets a "tuple" in a user defined type at the specified name.
     pub fn set_tuple_by_name<S>(&mut self, name: S, value: Tuple) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
-            cass_user_type_set_tuple_by_name(self.0, name.as_ptr(), value.inner())
-                .to_result(self)
+            cass_user_type_set_tuple_by_name(self.0, name.as_ptr(), value.inner()).to_result(self)
         }
     }
 
     /// Sets a user defined type in a user defined type at the specified index.
     pub fn set_user_type(&mut self, index: usize, value: UserType) -> Result<&mut Self> {
-        unsafe {
-            cass_user_type_set_user_type(self.0, index, value.0)
-                .to_result(self)
-        }
+        unsafe { cass_user_type_set_user_type(self.0, index, value.0).to_result(self) }
     }
 
     /// Sets a user defined type in a user defined type at the specified name.
     pub fn set_user_type_by_name<S>(&mut self, name: S, value: UserType) -> Result<&mut Self>
-        where S: Into<String> {
+    where
+        S: Into<String>,
+    {
         unsafe {
             let name = CString::new(name.into())?;
-            cass_user_type_set_user_type_by_name(self.0, name.as_ptr(), value.0)
-                .to_result(self)
+            cass_user_type_set_user_type_by_name(self.0, name.as_ptr(), value.0).to_result(self)
         }
     }
 }
diff --git a/src/cassandra/uuid.rs b/src/cassandra/uuid.rs
index b6a42d9..7061969 100644
--- a/src/cassandra/uuid.rs
+++ b/src/cassandra/uuid.rs
@@ -1,45 +1,48 @@
+use crate::cassandra::error::*;
+use crate::cassandra::util::Protected;
+
+use crate::cassandra_sys::cass_uuid_from_string;
+use crate::cassandra_sys::cass_uuid_gen_free;
+use crate::cassandra_sys::cass_uuid_gen_from_time;
+use crate::cassandra_sys::cass_uuid_gen_new;
+use crate::cassandra_sys::cass_uuid_gen_new_with_node;
+use crate::cassandra_sys::cass_uuid_gen_random;
+use crate::cassandra_sys::cass_uuid_gen_time;
+use crate::cassandra_sys::cass_uuid_max_from_time;
+use crate::cassandra_sys::cass_uuid_min_from_time;
+use crate::cassandra_sys::cass_uuid_string;
+use crate::cassandra_sys::cass_uuid_timestamp;
+use crate::cassandra_sys::cass_uuid_version;
+use crate::cassandra_sys::CassUuid as _Uuid;
+use crate::cassandra_sys::CassUuidGen as _UuidGen;
 
-
-use cassandra::util::Protected;
-use cassandra::error::*;
-
-use cassandra_sys::CassUuid as _Uuid;
-use cassandra_sys::CassUuidGen as _UuidGen;
-use cassandra_sys::cass_uuid_from_string;
-use cassandra_sys::cass_uuid_gen_free;
-use cassandra_sys::cass_uuid_gen_from_time;
-use cassandra_sys::cass_uuid_gen_new;
-use cassandra_sys::cass_uuid_gen_new_with_node;
-use cassandra_sys::cass_uuid_gen_random;
-use cassandra_sys::cass_uuid_gen_time;
-use cassandra_sys::cass_uuid_max_from_time;
-use cassandra_sys::cass_uuid_min_from_time;
-use cassandra_sys::cass_uuid_string;
-use cassandra_sys::cass_uuid_timestamp;
-use cassandra_sys::cass_uuid_version;
-
+use std::cmp::Ordering;
 use std::ffi::CString;
 use std::fmt;
-use std::fmt::{Debug, Display};
 use std::fmt::Formatter;
+use std::fmt::{Debug, Display};
 use std::mem;
 use std::str;
-use std::cmp::Ordering;
 
 const CASS_UUID_STRING_LENGTH: usize = 37;
 
-
-#[derive(Copy,Clone)]
+#[derive(Copy, Clone)]
 /// Version 1 (time-based) or version 4 (random) UUID.
 pub struct Uuid(_Uuid);
 
 impl Protected<_Uuid> for Uuid {
-    fn inner(&self) -> _Uuid { self.0 }
-    fn build(inner: _Uuid) -> Self { Uuid(inner) }
+    fn inner(&self) -> _Uuid {
+        self.0
+    }
+    fn build(inner: _Uuid) -> Self {
+        Uuid(inner)
+    }
 }
 
 impl Default for Uuid {
-    fn default() -> Uuid { unsafe { ::std::mem::zeroed() } }
+    fn default() -> Uuid {
+        unsafe { ::std::mem::zeroed() }
+    }
 }
 
 /// A UUID generator object.
@@ -51,18 +54,22 @@ unsafe impl Sync for UuidGen {}
 unsafe impl Send for UuidGen {}
 
 impl Drop for UuidGen {
-    fn drop(&mut self) { unsafe { cass_uuid_gen_free(self.0) } }
+    fn drop(&mut self) {
+        unsafe { cass_uuid_gen_free(self.0) }
+    }
 }
 
 impl Debug for Uuid {
-    fn fmt(&self, f: &mut Formatter) -> fmt::Result { fmt::Display::fmt(self, f) }
+    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+        fmt::Display::fmt(self, f)
+    }
 }
 
 impl Display for Uuid {
     fn fmt(&self, f: &mut Formatter) -> fmt::Result {
         unsafe {
             // Allocate a CString large enough for cass_uuid_string to write to.
-            let mut buf = CString::from_vec_unchecked(vec!(0u8; CASS_UUID_STRING_LENGTH));
+            let mut buf = CString::from_vec_unchecked(vec![0u8; CASS_UUID_STRING_LENGTH]);
             let cstr = buf.into_raw(); // Convert to *mut c_char
             cass_uuid_string(self.0, cstr); // Write the UUID to *c_char
             buf = CString::from_raw(cstr); // Convert from *c_char back to a CString.
@@ -77,16 +84,24 @@ impl Display for Uuid {
 
 impl Uuid {
     /// Generates a V1 (time) UUID for the specified time.
-    pub fn min_from_time(&mut self, time: u64) { unsafe { cass_uuid_min_from_time(time, &mut self.0) } }
+    pub fn min_from_time(&mut self, time: u64) {
+        unsafe { cass_uuid_min_from_time(time, &mut self.0) }
+    }
 
     /// Sets the UUID to the minimum V1 (time) value for the specified tim
-    pub fn max_from_time(&mut self, time: u64) { unsafe { cass_uuid_max_from_time(time, &mut self.0) } }
+    pub fn max_from_time(&mut self, time: u64) {
+        unsafe { cass_uuid_max_from_time(time, &mut self.0) }
+    }
 
     /// Gets the timestamp for a V1 UUID
-    pub fn timestamp(&self) -> u64 { unsafe { cass_uuid_timestamp(self.0) } }
+    pub fn timestamp(&self) -> u64 {
+        unsafe { cass_uuid_timestamp(self.0) }
+    }
 
     /// Gets the version for a UUID
-    pub fn version(&self) -> u8 { unsafe { cass_uuid_version(self.0) } }
+    pub fn version(&self) -> u8 {
+        unsafe { cass_uuid_version(self.0) }
+    }
 }
 
 impl str::FromStr for Uuid {
@@ -95,7 +110,8 @@ impl str::FromStr for Uuid {
         unsafe {
             let mut uuid = mem::zeroed();
             let str_cstr = CString::new(str)?;
-            cass_uuid_from_string(str_cstr.as_ptr(), &mut uuid).to_result(())
+            cass_uuid_from_string(str_cstr.as_ptr(), &mut uuid)
+                .to_result(())
                 .and_then(|_| Ok(Uuid(uuid)))
         }
     }
@@ -103,8 +119,8 @@ impl str::FromStr for Uuid {
 
 impl PartialEq for Uuid {
     fn eq(&self, other: &Uuid) -> bool {
-        self.0.time_and_version == other.0.time_and_version &&
-            self.0.clock_seq_and_node == other.0.clock_seq_and_node
+        self.0.time_and_version == other.0.time_and_version
+            && self.0.clock_seq_and_node == other.0.clock_seq_and_node
     }
 }
 
@@ -112,27 +128,33 @@ impl Eq for Uuid {}
 
 impl Ord for Uuid {
     fn cmp(&self, other: &Uuid) -> Ordering {
-        self.0.time_and_version.cmp(&other.0.time_and_version)
+        self.0
+            .time_and_version
+            .cmp(&other.0.time_and_version)
             .then(self.0.clock_seq_and_node.cmp(&other.0.clock_seq_and_node))
     }
 }
 
 impl PartialOrd for Uuid {
     fn partial_cmp(&self, other: &Uuid) -> Option<Ordering> {
-       Some(self.cmp(other))
+        Some(self.cmp(other))
     }
 }
 
 impl Default for UuidGen {
     /// Creates a new thread-safe UUID generator
-    fn default() -> Self { unsafe { UuidGen(cass_uuid_gen_new()) } }
+    fn default() -> Self {
+        unsafe { UuidGen(cass_uuid_gen_new()) }
+    }
 }
 
 impl UuidGen {
     /// Creates a new UUID generator with custom node information.
     /// <b>Note:</b> This object is thread-safe. It is best practice to create and reuse
     /// a single object per application.
-    pub fn new_with_node(node: u64) -> UuidGen { unsafe { UuidGen(cass_uuid_gen_new_with_node(node)) } }
+    pub fn new_with_node(node: u64) -> UuidGen {
+        unsafe { UuidGen(cass_uuid_gen_new_with_node(node)) }
+    }
 
     /// Generates a V1 (time) UUID.
     pub fn gen_time(&self) -> Uuid {
diff --git a/src/cassandra/value.rs b/src/cassandra/value.rs
index 6b28dcf..150ce16 100644
--- a/src/cassandra/value.rs
+++ b/src/cassandra/value.rs
@@ -1,71 +1,69 @@
-
-
-use cassandra::data_type::ConstDataType;
-use cassandra::inet::Inet;
-use cassandra::iterator::MapIterator;
-use cassandra::iterator::SetIterator;
-use cassandra::iterator::UserTypeIterator;
-use cassandra::util::Protected;
-use cassandra::uuid::Uuid;
-use cassandra::error::*;
-
-use cassandra_sys::CASS_ERROR_LIB_INVALID_VALUE_TYPE;
-use cassandra_sys::CASS_ERROR_LIB_NULL_VALUE;
-use cassandra_sys::CASS_VALUE_TYPE_ASCII;
-use cassandra_sys::CASS_VALUE_TYPE_BIGINT;
-use cassandra_sys::CASS_VALUE_TYPE_BLOB;
-use cassandra_sys::CASS_VALUE_TYPE_BOOLEAN;
-use cassandra_sys::CASS_VALUE_TYPE_COUNTER;
-use cassandra_sys::CASS_VALUE_TYPE_CUSTOM;
-use cassandra_sys::CASS_VALUE_TYPE_DATE;
-use cassandra_sys::CASS_VALUE_TYPE_DECIMAL;
-use cassandra_sys::CASS_VALUE_TYPE_DOUBLE;
-use cassandra_sys::CASS_VALUE_TYPE_FLOAT;
-use cassandra_sys::CASS_VALUE_TYPE_INET;
-use cassandra_sys::CASS_VALUE_TYPE_INT;
-use cassandra_sys::CASS_VALUE_TYPE_LAST_ENTRY;
-use cassandra_sys::CASS_VALUE_TYPE_LIST;
-use cassandra_sys::CASS_VALUE_TYPE_MAP;
-use cassandra_sys::CASS_VALUE_TYPE_SET;
-use cassandra_sys::CASS_VALUE_TYPE_SMALL_INT;
-use cassandra_sys::CASS_VALUE_TYPE_TEXT;
-use cassandra_sys::CASS_VALUE_TYPE_TIME;
-use cassandra_sys::CASS_VALUE_TYPE_TIMESTAMP;
-use cassandra_sys::CASS_VALUE_TYPE_TIMEUUID;
-use cassandra_sys::CASS_VALUE_TYPE_TINY_INT;
-use cassandra_sys::CASS_VALUE_TYPE_DURATION;
-use cassandra_sys::CASS_VALUE_TYPE_TUPLE;
-use cassandra_sys::CASS_VALUE_TYPE_UDT;
-use cassandra_sys::CASS_VALUE_TYPE_UNKNOWN;
-use cassandra_sys::CASS_VALUE_TYPE_UUID;
-use cassandra_sys::CASS_VALUE_TYPE_VARCHAR;
-use cassandra_sys::CASS_VALUE_TYPE_VARINT;
-use cassandra_sys::CassValue as _CassValue;
-use cassandra_sys::CassValueType_;
-use cassandra_sys::cass_collection_append_decimal;
-use cassandra_sys::cass_iterator_from_collection;
-use cassandra_sys::cass_iterator_from_map;
-use cassandra_sys::cass_iterator_fields_from_user_type;
-use cassandra_sys::cass_true;
-use cassandra_sys::cass_value_data_type;
-use cassandra_sys::cass_value_get_bool;
-use cassandra_sys::cass_value_get_bytes;
-use cassandra_sys::cass_value_get_double;
-use cassandra_sys::cass_value_get_float;
-use cassandra_sys::cass_value_get_inet;
-use cassandra_sys::cass_value_get_int16;
-use cassandra_sys::cass_value_get_int32;
-use cassandra_sys::cass_value_get_int64;
-use cassandra_sys::cass_value_get_int8;
-use cassandra_sys::cass_value_get_string;
-use cassandra_sys::cass_value_get_uint32;
-use cassandra_sys::cass_value_get_uuid;
-use cassandra_sys::cass_value_is_collection;
-use cassandra_sys::cass_value_is_null;
-use cassandra_sys::cass_value_item_count;
-use cassandra_sys::cass_value_primary_sub_type;
-use cassandra_sys::cass_value_secondary_sub_type;
-use cassandra_sys::cass_value_type;
+use crate::cassandra::data_type::ConstDataType;
+use crate::cassandra::error::*;
+use crate::cassandra::inet::Inet;
+use crate::cassandra::iterator::MapIterator;
+use crate::cassandra::iterator::SetIterator;
+use crate::cassandra::iterator::UserTypeIterator;
+use crate::cassandra::util::Protected;
+use crate::cassandra::uuid::Uuid;
+
+use crate::cassandra_sys::cass_collection_append_decimal;
+use crate::cassandra_sys::cass_iterator_fields_from_user_type;
+use crate::cassandra_sys::cass_iterator_from_collection;
+use crate::cassandra_sys::cass_iterator_from_map;
+use crate::cassandra_sys::cass_true;
+use crate::cassandra_sys::cass_value_data_type;
+use crate::cassandra_sys::cass_value_get_bool;
+use crate::cassandra_sys::cass_value_get_bytes;
+use crate::cassandra_sys::cass_value_get_double;
+use crate::cassandra_sys::cass_value_get_float;
+use crate::cassandra_sys::cass_value_get_inet;
+use crate::cassandra_sys::cass_value_get_int16;
+use crate::cassandra_sys::cass_value_get_int32;
+use crate::cassandra_sys::cass_value_get_int64;
+use crate::cassandra_sys::cass_value_get_int8;
+use crate::cassandra_sys::cass_value_get_string;
+use crate::cassandra_sys::cass_value_get_uint32;
+use crate::cassandra_sys::cass_value_get_uuid;
+use crate::cassandra_sys::cass_value_is_collection;
+use crate::cassandra_sys::cass_value_is_null;
+use crate::cassandra_sys::cass_value_item_count;
+use crate::cassandra_sys::cass_value_primary_sub_type;
+use crate::cassandra_sys::cass_value_secondary_sub_type;
+use crate::cassandra_sys::cass_value_type;
+use crate::cassandra_sys::CassValue as _CassValue;
+use crate::cassandra_sys::CassValueType_;
+use crate::cassandra_sys::CASS_ERROR_LIB_INVALID_VALUE_TYPE;
+use crate::cassandra_sys::CASS_ERROR_LIB_NULL_VALUE;
+use crate::cassandra_sys::CASS_VALUE_TYPE_ASCII;
+use crate::cassandra_sys::CASS_VALUE_TYPE_BIGINT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_BLOB;
+use crate::cassandra_sys::CASS_VALUE_TYPE_BOOLEAN;
+use crate::cassandra_sys::CASS_VALUE_TYPE_COUNTER;
+use crate::cassandra_sys::CASS_VALUE_TYPE_CUSTOM;
+use crate::cassandra_sys::CASS_VALUE_TYPE_DATE;
+use crate::cassandra_sys::CASS_VALUE_TYPE_DECIMAL;
+use crate::cassandra_sys::CASS_VALUE_TYPE_DOUBLE;
+use crate::cassandra_sys::CASS_VALUE_TYPE_DURATION;
+use crate::cassandra_sys::CASS_VALUE_TYPE_FLOAT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_INET;
+use crate::cassandra_sys::CASS_VALUE_TYPE_INT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_LAST_ENTRY;
+use crate::cassandra_sys::CASS_VALUE_TYPE_LIST;
+use crate::cassandra_sys::CASS_VALUE_TYPE_MAP;
+use crate::cassandra_sys::CASS_VALUE_TYPE_SET;
+use crate::cassandra_sys::CASS_VALUE_TYPE_SMALL_INT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TEXT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TIME;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TIMESTAMP;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TIMEUUID;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TINY_INT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_TUPLE;
+use crate::cassandra_sys::CASS_VALUE_TYPE_UDT;
+use crate::cassandra_sys::CASS_VALUE_TYPE_UNKNOWN;
+use crate::cassandra_sys::CASS_VALUE_TYPE_UUID;
+use crate::cassandra_sys::CASS_VALUE_TYPE_VARCHAR;
+use crate::cassandra_sys::CASS_VALUE_TYPE_VARINT;
 
 use std::ffi::CString;
 use std::fmt;
@@ -75,7 +73,6 @@ use std::ptr;
 use std::slice;
 use std::str;
 
-
 /// The type of a Cassandra value.
 #[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)]
 #[allow(missing_docs)] // Meanings are defined in CQL documentation.
@@ -142,7 +139,6 @@ enhance_nullary_enum!(ValueType, CassValueType_, {
     (TUPLE, CASS_VALUE_TYPE_TUPLE, "TUPLE"),
 }, omit { CASS_VALUE_TYPE_LAST_ENTRY });
 
-
 /// A single primitive value or a collection of values.
 pub struct Value(*const _CassValue);
 
@@ -150,20 +146,31 @@ pub struct Value(*const _CassValue);
 unsafe impl Send for Value {}
 unsafe impl Sync for Value {}
 
-
 impl Protected<*const _CassValue> for Value {
-    fn inner(&self) -> *const _CassValue { self.0 }
-    fn build(inner: *const _CassValue) -> Self { if inner.is_null() { panic!("Unexpected null pointer") }; Value(inner) }
+    fn inner(&self) -> *const _CassValue {
+        self.0
+    }
+    fn build(inner: *const _CassValue) -> Self {
+        if inner.is_null() {
+            panic!("Unexpected null pointer")
+        };
+        Value(inner)
+    }
 }
 
 /// Write a set iterator to a formatter.
 pub(crate) fn write_set<F>(f: &mut Formatter, set: Result<SetIterator>, writer: F) -> fmt::Result
-    where F: Fn(&mut Formatter, Value) -> fmt::Result
+where
+    F: Fn(&mut Formatter, Value) -> fmt::Result,
 {
     write!(f, "[")?;
     match set {
         Err(_) => write!(f, "<error>")?,
-        Ok(iter) => for item in iter { writer(f, item)? },
+        Ok(iter) => {
+            for item in iter {
+                writer(f, item)?
+            }
+        }
     }
     write!(f, "]")?;
     Ok(())
@@ -171,19 +178,25 @@ pub(crate) fn write_set<F>(f: &mut Formatter, set: Result<SetIterator>, writer:
 
 /// Write a map iterator to a formatter.
 pub(crate) fn write_map<F>(f: &mut Formatter, set: Result<MapIterator>, writer: F) -> fmt::Result
-    where F: Fn(&mut Formatter, Value, Value) -> fmt::Result
+where
+    F: Fn(&mut Formatter, Value, Value) -> fmt::Result,
 {
     write!(f, "{{")?;
     match set {
         Err(_) => write!(f, "<error>")?,
-        Ok(iter) => for item in iter { writer(f, item.0, item.1)? },
+        Ok(iter) => {
+            for item in iter {
+                writer(f, item.0, item.1)?
+            }
+        }
     }
     write!(f, "}}")?;
     Ok(())
 }
 
 pub(crate) fn write_value<T, F>(f: &mut Formatter, v: Result<T>, writer: F) -> fmt::Result
-    where F: Fn(&mut Formatter, T) -> fmt::Result
+where
+    F: Fn(&mut Formatter, T) -> fmt::Result,
 {
     match v {
         Err(_) => write!(f, "<error>"),
@@ -199,9 +212,9 @@ impl Debug for Value {
             match self.get_type() {
                 ValueType::UNKNOWN => write!(f, "<unknown>"),
                 ValueType::CUSTOM => write!(f, "<custom>"),
-                ValueType::ASCII |
-                ValueType::TEXT |
-                ValueType::VARCHAR => write_value(f, self.get_string(), |f, v| write!(f, "{:?}", v)),
+                ValueType::ASCII | ValueType::TEXT | ValueType::VARCHAR => {
+                    write_value(f, self.get_string(), |f, v| write!(f, "{:?}", v))
+                }
                 ValueType::DECIMAL => write_value(f, self.get_bytes(), |f, v| write!(f, "{:?}", v)),
                 ValueType::COUNTER => write_value(f, self.get_i64(), |f, v| write!(f, "{:?}", v)),
                 ValueType::BIGINT => write_value(f, self.get_i64(), |f, v| write!(f, "{:?}", v)),
@@ -218,11 +231,16 @@ impl Debug for Value {
                 ValueType::DURATION => write_value(f, self.get_i32(), |f, v| write!(f, "{:?}", v)),
                 ValueType::INET => write_value(f, self.get_inet(), |f, v| write!(f, "{:?}", v)),
                 ValueType::TIMESTAMP => write_value(f, self.get_i64(), |f, v| write!(f, "{:?}", v)),
-                ValueType::TIMEUUID => write_value(f, self.get_uuid(), |f, v| write!(f, "TIMEUUID: {}", v)),
+                ValueType::TIMEUUID => {
+                    write_value(f, self.get_uuid(), |f, v| write!(f, "TIMEUUID: {}", v))
+                }
                 ValueType::UUID => write_value(f, self.get_uuid(), |f, v| write!(f, "UUID: {}", v)),
-                ValueType::SET |
-                ValueType::LIST => write_set(f, self.get_set(), |f, i| write!(f, "{:?}, ", i)),
-                ValueType::MAP => write_map(f, self.get_map(), |f, k, v| write!(f, "{:?} => {:?}, ", k, v)),
+                ValueType::SET | ValueType::LIST => {
+                    write_set(f, self.get_set(), |f, i| write!(f, "{:?}, ", i))
+                }
+                ValueType::MAP => write_map(f, self.get_map(), |f, k, v| {
+                    write!(f, "{:?} => {:?}, ", k, v)
+                }),
                 ValueType::UDT => write!(f, "<udt>"),
                 ValueType::TUPLE => write_set(f, self.get_set(), |f, i| write!(f, "{:?}, ", i)),
             }
@@ -238,30 +256,43 @@ impl Display for Value {
             match self.get_type() {
                 ValueType::UNKNOWN => write!(f, "{}", "unknown"),
                 ValueType::CUSTOM => write!(f, "{}", "custom"),
-                ValueType::ASCII |
-                ValueType::TEXT |
-                ValueType::VARCHAR => write_value(f, self.get_string(), |f, v| write!(f, "{}", v)),
-                ValueType::DECIMAL => write_value(f, self.get_bytes(), |f, v| write!(f, "DECIMAL:{:?}", v)),
+                ValueType::ASCII | ValueType::TEXT | ValueType::VARCHAR => {
+                    write_value(f, self.get_string(), |f, v| write!(f, "{}", v))
+                }
+                ValueType::DECIMAL => {
+                    write_value(f, self.get_bytes(), |f, v| write!(f, "DECIMAL:{:?}", v))
+                }
                 ValueType::COUNTER => write_value(f, self.get_i64(), |f, v| write!(f, "{}", v)),
                 ValueType::BIGINT => write_value(f, self.get_i64(), |f, v| write!(f, "{}", v)),
                 ValueType::DATE => write_value(f, self.get_string(), |f, v| write!(f, "{}", v)),
                 ValueType::TIME => write_value(f, self.get_string(), |f, v| write!(f, "{}", v)),
-                ValueType::VARINT => write_value(f, self.get_bytes(), |f, v| write!(f, "VARINT:{:?}", v)),
+                ValueType::VARINT => {
+                    write_value(f, self.get_bytes(), |f, v| write!(f, "VARINT:{:?}", v))
+                }
                 ValueType::BOOLEAN => write_value(f, self.get_bool(), |f, v| write!(f, "{}", v)),
                 ValueType::DOUBLE => write_value(f, self.get_f64(), |f, v| write!(f, "{}", v)),
                 ValueType::FLOAT => write_value(f, self.get_f32(), |f, v| write!(f, "{}", v)),
-                ValueType::BLOB => write_value(f, self.get_bytes(), |f, v| write!(f, "BLOB:{:?}", v)),
+                ValueType::BLOB => {
+                    write_value(f, self.get_bytes(), |f, v| write!(f, "BLOB:{:?}", v))
+                }
                 ValueType::INT => write_value(f, self.get_i32(), |f, v| write!(f, "{}", v)),
                 ValueType::SMALL_INT => write_value(f, self.get_i16(), |f, v| write!(f, "{}", v)),
                 ValueType::TINY_INT => write_value(f, self.get_i8(), |f, v| write!(f, "{}", v)),
                 ValueType::DURATION => write_value(f, self.get_i32(), |f, v| write!(f, "{:?}", v)),
-                ValueType::INET => write_value(f, self.get_inet(), |f, v| write!(f, "INET:{:?}", v)),
+                ValueType::INET => {
+                    write_value(f, self.get_inet(), |f, v| write!(f, "INET:{:?}", v))
+                }
                 ValueType::TIMESTAMP => write_value(f, self.get_i64(), |f, v| write!(f, "{}", v)),
-                ValueType::TIMEUUID => write_value(f, self.get_uuid(), |f, v| write!(f, "TIMEUUID:{}", v)),
+                ValueType::TIMEUUID => {
+                    write_value(f, self.get_uuid(), |f, v| write!(f, "TIMEUUID:{}", v))
+                }
                 ValueType::UUID => write_value(f, self.get_uuid(), |f, v| write!(f, "UUID:{}", v)),
-                ValueType::SET |
-                ValueType::LIST => write_set(f, self.get_set(), |f, i| write!(f, "{}, ", i)),
-                ValueType::MAP => write_map(f, self.get_map(), |f, k, v| write!(f, "{} => {}, ", k, v)),
+                ValueType::SET | ValueType::LIST => {
+                    write_set(f, self.get_set(), |f, i| write!(f, "{}, ", i))
+                }
+                ValueType::MAP => {
+                    write_map(f, self.get_map(), |f, k, v| write!(f, "{} => {}, ", k, v))
+                }
                 ValueType::UDT => write!(f, "<udt>"),
                 ValueType::TUPLE => write_set(f, self.get_set(), |f, i| write!(f, "{}, ", i)),
             }
@@ -270,7 +301,6 @@ impl Display for Value {
 }
 
 impl Value {
-
     /// Get the raw bytes of this Cassandra value.
     #[allow(cast_possible_truncation)]
     pub fn get_bytes(&self) -> Result<&[u8]> {
@@ -290,23 +320,29 @@ impl Value {
     //    }}
 
     /// Get the type of this Cassandra value
-    pub fn get_type(&self) -> ValueType { unsafe { ValueType::build(cass_value_type(self.0)) } }
+    pub fn get_type(&self) -> ValueType {
+        unsafe { ValueType::build(cass_value_type(self.0)) }
+    }
 
     /// Get the data type of this Cassandra value
-    pub fn data_type(&self) -> ConstDataType { unsafe { ConstDataType::build(cass_value_data_type(self.0)) } }
+    pub fn data_type(&self) -> ConstDataType {
+        unsafe { ConstDataType::build(cass_value_data_type(self.0)) }
+    }
 
     /// Returns true if a specified value is null.
-    pub fn is_null(&self) -> bool { unsafe { cass_value_is_null(self.0) == cass_true } }
+    pub fn is_null(&self) -> bool {
+        unsafe { cass_value_is_null(self.0) == cass_true }
+    }
 
     /// Returns true if a specified value is a collection.
-    pub fn is_collection(&self) -> bool { unsafe { cass_value_is_collection(self.0) == cass_true } }
-
+    pub fn is_collection(&self) -> bool {
+        unsafe { cass_value_is_collection(self.0) == cass_true }
+    }
 
     //    pub fn item_count(&self) -> u64 {
     //        unsafe { cass_value_item_count(self.0) }
     //    }
 
-
     // 	///Get the primary sub-type for a collection. This returns the sub-type for a
     // 	///list or set and the key type for a map.
     //    pub fn primary_sub_type(&self) -> ValueType {
@@ -348,7 +384,7 @@ impl Value {
                     } else {
                         Ok(MapIterator::build(iter))
                     }
-                },
+                }
                 _ => Err(CASS_ERROR_LIB_INVALID_VALUE_TYPE.to_error()),
             }
         }
@@ -366,7 +402,7 @@ impl Value {
                     } else {
                         Ok(UserTypeIterator::build(iter))
                     }
-                },
+                }
                 _ => Err(CASS_ERROR_LIB_INVALID_VALUE_TYPE.to_error()),
             }
         }
@@ -377,12 +413,13 @@ impl Value {
         unsafe {
             let mut message_ptr = mem::zeroed();
             let mut message_length = mem::zeroed();
-            cass_value_get_string(self.0, &mut message_ptr, &mut message_length).to_result(())
+            cass_value_get_string(self.0, &mut message_ptr, &mut message_length)
+                .to_result(())
                 .and_then(|_| {
-                    let slice = slice::from_raw_parts(message_ptr as *const u8, message_length as usize);
+                    let slice =
+                        slice::from_raw_parts(message_ptr as *const u8, message_length as usize);
                     Ok(str::from_utf8(slice)?)
-                }
-            )
+                })
         }
     }
 
@@ -395,8 +432,7 @@ impl Value {
     pub fn get_inet(&self) -> Result<Inet> {
         unsafe {
             let mut inet = mem::zeroed();
-            cass_value_get_inet(self.0, &mut inet)
-                .to_result(Inet::build(inet))
+            cass_value_get_inet(self.0, &mut inet).to_result(Inet::build(inet))
         }
     }
 
@@ -404,8 +440,7 @@ impl Value {
     pub fn get_i32(&self) -> Result<i32> {
         unsafe {
             let mut output = mem::zeroed();
-            cass_value_get_int32(self.0, &mut output)
-                .to_result(output)
+            cass_value_get_int32(self.0, &mut output).to_result(output)
         }
     }
 
@@ -413,8 +448,7 @@ impl Value {
     pub fn get_u32(&self) -> Result<u32> {
         unsafe {
             let mut output = mem::zeroed();
-            cass_value_get_uint32(self.0, &mut output)
-                .to_result(output)
+            cass_value_get_uint32(self.0, &mut output).to_result(output)
         }
     }
 
@@ -422,8 +456,7 @@ impl Value {
     pub fn get_i16(&self) -> Result<i16> {
         unsafe {
             let mut output = mem::zeroed();
-            cass_value_get_int16(self.0, &mut output)
-                .to_result(output)
+            cass_value_get_int16(self.0, &mut output).to_result(output)
         }
     }
 
@@ -431,8 +464,7 @@ impl Value {
     pub fn get_i8(&self) -> Result<i8> {
         unsafe {
             let mut output = mem::zeroed();
-            cass_value_get_int8(self.0, &mut output)
-                .to_result(output)
+            cass_value_get_int8(self.0, &mut output).to_result(output)
         }
     }
 
@@ -440,8 +472,7 @@ impl Value {
     pub fn get_i64(&self) -> Result<i64> {
         unsafe {
             let mut output = mem::zeroed();
-            cass_value_get_int64(self.0, &mut output)
-                .to_result(output)
+            cass_value_get_int64(self.0, &mut output).to_result(output)
         }
     }
 
@@ -449,8 +480,7 @@ impl Value {
     pub fn get_f32(&self) -> Result<f32> {
         unsafe {
             let mut output = mem::zeroed();
-            cass_value_get_float(self.0, &mut output)
-                .to_result(output)
+            cass_value_get_float(self.0, &mut output).to_result(output)
         }
     }
 
@@ -458,8 +488,7 @@ impl Value {
     pub fn get_f64(&self) -> Result<f64> {
         unsafe {
             let mut output = mem::zeroed();
-            cass_value_get_double(self.0, &mut output)
-                .to_result(output)
+            cass_value_get_double(self.0, &mut output).to_result(output)
         }
     }
 
@@ -467,8 +496,7 @@ impl Value {
     pub fn get_bool(&self) -> Result<bool> {
         unsafe {
             let mut output = mem::zeroed();
-            cass_value_get_bool(self.0, &mut output)
-                .to_result(output == cass_true)
+            cass_value_get_bool(self.0, &mut output).to_result(output == cass_true)
         }
     }
 
@@ -476,8 +504,7 @@ impl Value {
     pub fn get_uuid(&self) -> Result<Uuid> {
         unsafe {
             let mut uuid = mem::zeroed();
-            cass_value_get_uuid(self.0, &mut uuid)
-                .to_result(Uuid::build(uuid))
+            cass_value_get_uuid(self.0, &mut uuid).to_result(Uuid::build(uuid))
         }
     }
 }
diff --git a/src/cassandra/write_type.rs b/src/cassandra/write_type.rs
index 46d9705..1dfd552 100644
--- a/src/cassandra/write_type.rs
+++ b/src/cassandra/write_type.rs
@@ -1,5 +1,5 @@
-use cassandra::util::Protected;
-use cassandra_sys::CassWriteType_;
+use crate::cassandra::util::Protected;
+use crate::cassandra_sys::CassWriteType_;
 
 /// A Cassandra write type level.
 #[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)]
diff --git a/src/lib.rs b/src/lib.rs
index 48a0e31..2a9e576 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,95 +2,91 @@
 #![deny(missing_docs)]
 #![allow(unknown_lints)]
 #![allow(doc_markdown)]
-#![allow(unused_imports)]  // TODO: remove
-#![allow(dead_code)]  // TODO: remove
+#![allow(unused_imports)] // TODO: remove
+#![allow(dead_code)] // TODO: remove
 // `error_chain!` can recurse deeply
 #![recursion_limit = "1024"]
 
 #[macro_use]
 extern crate slog;
-extern crate decimal;
-extern crate time;
-extern crate uuid;
-extern crate futures;
-extern crate cassandra_cpp_sys;
-use cassandra_cpp_sys as cassandra_sys;
 #[macro_use]
 extern crate error_chain;
 
+use cassandra_cpp_sys as cassandra_sys;
 
-pub use cassandra::batch::{Batch, BatchType, CustomPayload};
-pub use cassandra::cluster::{Cluster, CqlProtocol};
-pub use cassandra::collection::{CassCollection, List, Map, Set};
-pub use cassandra::consistency::Consistency;
-pub use cassandra::data_type::DataType;
+pub use crate::cassandra::batch::{Batch, BatchType, CustomPayload};
+pub use crate::cassandra::cluster::{Cluster, CqlProtocol};
+pub use crate::cassandra::collection::{CassCollection, List, Map, Set};
+pub use crate::cassandra::consistency::Consistency;
+pub use crate::cassandra::data_type::DataType;
 // pub use cassandra::write_type::*;
-pub use cassandra::field::Field;
-pub use cassandra::future::CassFuture;
-pub use cassandra::inet::Inet;
+pub use crate::cassandra::field::Field;
+pub use crate::cassandra::future::CassFuture;
+pub use crate::cassandra::inet::Inet;
 // pub use cassandra::util::*;
 // pub use cassandra::metrics::*;
-pub use cassandra::iterator::{AggregateIterator, ColumnIterator, FieldIterator, FunctionIterator, KeyspaceIterator,
-                              MapIterator, SetIterator, TableIterator, UserTypeIterator};
-pub use cassandra::log::{LogLevel, set_logger, set_level};
-pub use cassandra::policy::retry::RetryPolicy;
-pub use cassandra::prepared::PreparedStatement;
-pub use cassandra::result::CassResult;
-pub use cassandra::row::AsRustType;
-pub use cassandra::row::Row;
-pub use cassandra::schema::aggregate_meta::AggregateMeta;
-pub use cassandra::schema::column_meta::ColumnMeta;
-pub use cassandra::schema::function_meta::FunctionMeta;
-pub use cassandra::schema::keyspace_meta::KeyspaceMeta;
-pub use cassandra::schema::schema_meta::SchemaMeta;
-pub use cassandra::schema::table_meta::TableMeta;
-pub use cassandra::session::Session;
-pub use cassandra::ssl::{Ssl, SslVerifyFlag};
-pub use cassandra::statement::BindRustType;
-pub use cassandra::statement::Statement;
+pub use crate::cassandra::iterator::{
+    AggregateIterator, ColumnIterator, FieldIterator, FunctionIterator, KeyspaceIterator,
+    MapIterator, SetIterator, TableIterator, UserTypeIterator,
+};
+pub use crate::cassandra::log::{set_level, set_logger, LogLevel};
+pub use crate::cassandra::policy::retry::RetryPolicy;
+pub use crate::cassandra::prepared::PreparedStatement;
+pub use crate::cassandra::result::CassResult;
+pub use crate::cassandra::row::AsRustType;
+pub use crate::cassandra::row::Row;
+pub use crate::cassandra::schema::aggregate_meta::AggregateMeta;
+pub use crate::cassandra::schema::column_meta::ColumnMeta;
+pub use crate::cassandra::schema::function_meta::FunctionMeta;
+pub use crate::cassandra::schema::keyspace_meta::KeyspaceMeta;
+pub use crate::cassandra::schema::schema_meta::SchemaMeta;
+pub use crate::cassandra::schema::table_meta::TableMeta;
+pub use crate::cassandra::session::Session;
+pub use crate::cassandra::ssl::{Ssl, SslVerifyFlag};
+pub use crate::cassandra::statement::BindRustType;
+pub use crate::cassandra::statement::Statement;
 // pub use cassandra::custom_payload::CustomPayload;
-pub use cassandra::time::TimestampGen;
-pub use cassandra::tuple::Tuple;
-pub use cassandra::user_type::UserType;
-pub use cassandra::uuid::{Uuid, UuidGen};
-pub use cassandra::value::{Value, ValueType};
+pub use crate::cassandra::time::TimestampGen;
+pub use crate::cassandra::tuple::Tuple;
+pub use crate::cassandra::user_type::UserType;
+pub use crate::cassandra::uuid::{Uuid, UuidGen};
+pub use crate::cassandra::value::{Value, ValueType};
 
-pub use cassandra::error::*;
+pub use crate::cassandra::error::*;
 
 // #[macro_use]
 mod cassandra {
     #[macro_use]
     pub mod util;
+    pub mod batch;
+    pub mod cluster;
+    pub mod collection;
     pub mod consistency;
+    pub mod custom_payload;
+    pub mod data_type;
+    pub mod error;
     pub mod field;
-    pub mod inet;
-    pub mod uuid;
-    pub mod cluster;
-    pub mod session;
-    pub mod statement;
-    pub mod batch;
     pub mod future;
+    pub mod inet;
+    pub mod iterator;
+    pub mod log;
+    pub mod metrics;
+    pub mod policy;
     pub mod prepared;
     pub mod result;
-    pub mod iterator;
     pub mod row;
-    pub mod value;
-    pub mod collection;
-    pub mod ssl;
     pub mod schema;
-    pub mod log;
-    pub mod error;
-    pub mod user_type;
-    pub mod data_type;
-    pub mod tuple;
-    pub mod policy;
-    pub mod custom_payload;
+    pub mod session;
+    pub mod ssl;
+    pub mod statement;
     pub mod time;
-    pub mod metrics;
+    pub mod tuple;
+    pub mod user_type;
+    pub mod uuid;
+    pub mod value;
     pub mod write_type;
 }
 
-
 // #[phase(plugin)] extern crate bindgen;
 // #[allow(dead_code, uppercase_variables, non_camel_case_types)]
 // mod mysql_bindings {


Test patch:
diff --git a/tests/async.rs b/tests/async.rs
index 9405392..3445edc 100644
--- a/tests/async.rs
+++ b/tests/async.rs
@@ -1,11 +1,6 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
-use futures::Future;
-
 
 static NUM_CONCURRENT_REQUESTS: usize = 1000;
 
@@ -13,9 +8,11 @@ fn insert_into_async(session: &Session, key: String) -> Result<Vec<CassFuture<Ca
     let mut futures = Vec::<CassFuture<CassResult>>::new();
     for i in 0..NUM_CONCURRENT_REQUESTS {
         let key: &str = &(key.clone() + &i.to_string());
-        let mut statement = stmt!("INSERT INTO examples.async (key, bln, flt, dbl, i32, i64)
+        let mut statement = stmt!(
+            "INSERT INTO examples.async (key, bln, flt, dbl, i32, i64)
         	VALUES (?, ?, \
-                                   ?, ?, ?, ?);");
+                                   ?, ?, ?, ?);"
+        );
 
         statement.bind(0, key)?;
         statement.bind(1, i % 2 == 0)?;
@@ -35,8 +32,11 @@ pub fn test_async() {
     let session = help::create_test_session();
     help::create_example_keyspace(&session);
 
-    session.execute(&stmt!("CREATE TABLE IF NOT EXISTS examples.async(key text, bln boolean, flt float, dbl \
-                         double, i32 int, i64 bigint, PRIMARY KEY (key));"))
+    session
+        .execute(&stmt!(
+            "CREATE TABLE IF NOT EXISTS examples.async(key text, bln boolean, flt float, dbl \
+             double, i32 int, i64 bigint, PRIMARY KEY (key));"
+        ))
         .wait()
         .unwrap();
     session.execute(&stmt!("USE examples")).wait().unwrap();
diff --git a/tests/basic.rs b/tests/basic.rs
index 76f1481..373ff6c 100644
--- a/tests/basic.rs
+++ b/tests/basic.rs
@@ -1,21 +1,16 @@
-extern crate cassandra_cpp;
-extern crate futures;
-extern crate time;
-
 mod help;
 
 use cassandra_cpp::*;
-use futures::Future;
-use time::Duration;
 use std::time::SystemTime;
+use time::Duration;
 
-#[derive(Debug,PartialEq,Copy,Clone,Default)]
+#[derive(Debug, PartialEq, Copy, Clone, Default)]
 struct Udt {
     dt: u32,
     tm: i64,
 }
 
-#[derive(Debug,PartialEq,Copy,Clone,Default)]
+#[derive(Debug, PartialEq, Copy, Clone, Default)]
 struct Basic {
     bln: bool,
     flt: f32,
@@ -35,17 +30,21 @@ struct Basic {
 fn create_basic_table(session: &Session) {
     let type_statement = &stmt!("CREATE TYPE IF NOT EXISTS examples.udt (dt date, tm time);");
     session.execute(type_statement).wait().unwrap();
-    let table_statement = &stmt!("CREATE TABLE IF NOT EXISTS examples.basic (key text, bln boolean, flt \
-                                  float, dbl double, i8 tinyint, i16 smallint, i32 int, i64 bigint, \
-                                  ts timestamp, addr inet, tu timeuuid, id uuid, ct udt, PRIMARY KEY (key));");
+    let table_statement = &stmt!(
+        "CREATE TABLE IF NOT EXISTS examples.basic (key text, bln boolean, flt \
+         float, dbl double, i8 tinyint, i16 smallint, i32 int, i64 bigint, \
+         ts timestamp, addr inet, tu timeuuid, id uuid, ct udt, PRIMARY KEY (key));"
+    );
     session.execute(table_statement).wait().unwrap();
     let truncate_statement = &stmt!("TRUNCATE examples.basic;");
     session.execute(truncate_statement).wait().unwrap();
 }
 
 fn insert_into_basic(session: &Session, key: &str, basic: &Basic) -> Result<CassResult> {
-    let mut statement = stmt!("INSERT INTO examples.basic (key, bln, flt, dbl, i8, i16, i32, i64, ts, addr, tu, id, ct) \
-                               VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);");
+    let mut statement = stmt!(
+        "INSERT INTO examples.basic (key, bln, flt, dbl, i8, i16, i32, i64, ts, addr, tu, id, ct) \
+         VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"
+    );
 
     let ct_type = DataType::new_udt(2);
     ct_type.add_sub_value_type_by_name::<&str>("dt", ValueType::DATE)?;
@@ -105,16 +104,18 @@ fn select_from_basic(session: &Session, key: &str) -> Result<Option<Basic>> {
                 addr: row.get(9)?,
                 tu: row.get(10)?,
                 id: row.get(11)?,
-                ct: Udt{
-                    dt: dt,
-                    tm: tm,
-                },
+                ct: Udt { dt: dt, tm: tm },
             }))
         }
     }
 }
 
-fn select_from_basic_prepared(session: &Session, prepared: &PreparedStatement, key: &str, basic: &mut Basic) -> Result<()> {
+fn select_from_basic_prepared(
+    session: &Session,
+    prepared: &PreparedStatement,
+    key: &str,
+    basic: &mut Basic,
+) -> Result<()> {
     let mut statement = prepared.bind();
     statement.bind_string(0, key)?;
     let future = session.execute(&statement);
@@ -145,10 +146,7 @@ fn select_from_basic_prepared(session: &Session, prepared: &PreparedStatement, k
             }
         }
 
-        basic.ct = Udt{
-            dt: dt,
-            tm: tm,
-        };
+        basic.ct = Udt { dt: dt, tm: tm };
     }
     Ok(())
 }
@@ -177,7 +175,10 @@ fn test_simple() {
 fn test_basic_error() {
     let session = help::create_test_session();
     let s = stmt!("CREATE GOBBLEDEGOOK;");
-    session.execute(&s).wait().expect_err("Should cleanly return an error");
+    session
+        .execute(&s)
+        .wait()
+        .expect_err("Should cleanly return an error");
 }
 
 #[test]
@@ -187,7 +188,11 @@ fn test_basic_round_trip() {
     create_basic_table(&session);
     let uuid_gen = UuidGen::default();
 
-    let ts = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs() * 1_000;
+    let ts = SystemTime::now()
+        .duration_since(SystemTime::UNIX_EPOCH)
+        .unwrap()
+        .as_secs()
+        * 1_000;
     let input = Basic {
         bln: true,
         flt: 0.001f32,
@@ -207,7 +212,9 @@ fn test_basic_round_trip() {
     };
 
     insert_into_basic(&session, "test", &input).unwrap();
-    let output = select_from_basic(&session, "test").unwrap().expect("no output from select");
+    let output = select_from_basic(&session, "test")
+        .unwrap()
+        .expect("no output from select");
 
     println!("{:?}", input);
     println!("{:?}", output);
@@ -222,7 +229,11 @@ fn test_prepared_round_trip() {
     create_basic_table(&session);
     let uuid_gen = UuidGen::default();
 
-    let ts = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs() * 1_000;
+    let ts = SystemTime::now()
+        .duration_since(SystemTime::UNIX_EPOCH)
+        .unwrap()
+        .as_secs()
+        * 1_000;
     let input = Basic {
         bln: true,
         flt: 0.001f32,
@@ -245,7 +256,11 @@ fn test_prepared_round_trip() {
     println!("Basic insertions");
     insert_into_basic(&session, "prepared_test", &input).unwrap();
     println!("Preparing");
-    let prepared = session.prepare(SELECT_QUERY).unwrap().wait().expect("prepared");
+    let prepared = session
+        .prepare(SELECT_QUERY)
+        .unwrap()
+        .wait()
+        .expect("prepared");
     select_from_basic_prepared(&session, &prepared, "prepared_test", &mut output).unwrap();
     assert_eq!(input, output, "Input:  {:?}\noutput: {:?}", &input, &output);
 }
@@ -257,12 +272,15 @@ fn test_null_retrieval() {
     create_basic_table(&session);
 
     // Insert a partial row.
-    let partial = stmt!("INSERT INTO examples.basic (key, bln, flt) VALUES ('vacant', true, 3.14);");
+    let partial =
+        stmt!("INSERT INTO examples.basic (key, bln, flt) VALUES ('vacant', true, 3.14);");
     session.execute(&partial).wait().expect("insert");
 
     // Read the whole row.
-    let query = stmt!("SELECT key, bln, flt, dbl, i8, i16, i32, i64, ts, addr, tu, id, ct \
-                       FROM examples.basic WHERE key = 'vacant';");
+    let query = stmt!(
+        "SELECT key, bln, flt, dbl, i8, i16, i32, i64, ts, addr, tu, id, ct \
+         FROM examples.basic WHERE key = 'vacant';"
+    );
     let result = session.execute(&query).wait().expect("select");
 
     // Check response is as expected.
@@ -329,8 +347,10 @@ fn test_null_insertion() {
     create_basic_table(&session);
 
     // Insert some explicit nulls.
-    let mut s = stmt!("INSERT INTO examples.basic (key, bln, flt, dbl, i8, i16, i32, i64, ts, addr, tu, id, ct) \
-                       VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);");
+    let mut s = stmt!(
+        "INSERT INTO examples.basic (key, bln, flt, dbl, i8, i16, i32, i64, ts, addr, tu, id, ct) \
+         VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"
+    );
     s.bind(0, "shrdlu").unwrap();
     s.bind(1, false).unwrap();
     s.bind_null(2).unwrap();
@@ -347,8 +367,10 @@ fn test_null_insertion() {
     session.execute(&s).wait().unwrap();
 
     // Read them back.
-    let s = stmt!("SELECT key, bln, flt, dbl, i8, i16, i32, i64, ts, addr, tu, id, ct \
-                   FROM examples.basic WHERE key = 'shrdlu';");
+    let s = stmt!(
+        "SELECT key, bln, flt, dbl, i8, i16, i32, i64, ts, addr, tu, id, ct \
+         FROM examples.basic WHERE key = 'shrdlu';"
+    );
     let result = session.execute(&s).wait().expect("select");
     assert_eq!(1, result.row_count());
     let row = result.first_row().unwrap();
@@ -370,7 +392,12 @@ fn test_null_insertion() {
 
 /// Check for a needle in a haystack, and fail if not present.
 fn assert_contains(haystack: String, needle: &str) {
-    assert!(haystack.contains(needle), "assert_contains: `{}` not found in `{}`", needle, &haystack);
+    assert!(
+        haystack.contains(needle),
+        "assert_contains: `{}` not found in `{}`",
+        needle,
+        &haystack
+    );
 }
 
 #[test]
@@ -386,11 +413,17 @@ fn test_rendering() {
     // Check rendering of a column
     let column_debug = format!("{:?}", compaction_col);
     println!("Column debug: {}", &column_debug);
-    assert_contains(column_debug, r#"{"class" => "org.apache.cassandra.db.compaction"#);
+    assert_contains(
+        column_debug,
+        r#"{"class" => "org.apache.cassandra.db.compaction"#,
+    );
 
     let column_display = format!("{}", compaction_col);
     println!("Column display: {}", &column_display);
-    assert_contains(column_display, r#"{class => org.apache.cassandra.db.compaction"#);
+    assert_contains(
+        column_display,
+        r#"{class => org.apache.cassandra.db.compaction"#,
+    );
 
     // Check retrieving a string and a str.
     let keyspace_col = row.get_column_by_name("keyspace_name").unwrap();
@@ -402,7 +435,9 @@ fn test_rendering() {
     assert!(str.len() > 0, "empty string");
 
     // Check invalid retrieval type.
-    keyspace_col.get_map().expect_err("Should fail with invalid value type");
+    keyspace_col
+        .get_map()
+        .expect_err("Should fail with invalid value type");
 }
 
 #[test]
@@ -411,8 +446,11 @@ fn test_error_reporting() {
 
     // Simple error.
     let mut query = stmt!("SELECT * from system_schema.tables;");
-    query.set_consistency(Consistency::THREE).unwrap();  // assuming we only have one node, this must fail
-    let err = session.execute(&query).wait().expect_err("Should have failed!");
+    query.set_consistency(Consistency::THREE).unwrap(); // assuming we only have one node, this must fail
+    let err = session
+        .execute(&query)
+        .wait()
+        .expect_err("Should have failed!");
     println!("Got error {} kind {:?}", err, err.kind());
     match *err.kind() {
         ErrorKind::CassError(CassErrorCode::LIB_NO_HOSTS_AVAILABLE, _) => (),
@@ -421,10 +459,25 @@ fn test_error_reporting() {
 
     // Detailed error.
     let query = stmt!("SELECT gibberish from system_schema.tables;");
-    let err = session.execute(&query).wait().expect_err("Should have failed!");
+    let err = session
+        .execute(&query)
+        .wait()
+        .expect_err("Should have failed!");
     println!("Got error {} kind {:?}", err, err.kind());
     match *err.kind() {
-        ErrorKind::CassErrorResult(CassErrorCode::SERVER_INVALID_QUERY, _, _, -1, -1, -1, _, _, _, _, _) => (),
+        ErrorKind::CassErrorResult(
+            CassErrorCode::SERVER_INVALID_QUERY,
+            _,
+            _,
+            -1,
+            -1,
+            -1,
+            _,
+            _,
+            _,
+            _,
+            _,
+        ) => (),
         ref k => panic!("Unexpected error kind {}", k),
     }
 
@@ -437,7 +490,11 @@ fn test_error_reporting() {
     let query = stmt!("SELECT i32 FROM examples.basic WHERE key = 'utf8';");
     let result = session.execute(&query).wait().unwrap();
     let row = result.iter().next().unwrap();
-    let err = row.get_column(0).unwrap().get_string().expect_err("Should have failed");
+    let err = row
+        .get_column(0)
+        .unwrap()
+        .get_string()
+        .expect_err("Should have failed");
     println!("Got error {} kind {:?}", err, err.kind());
     match *err.kind() {
         ErrorKind::InvalidUtf8(_) => (),
@@ -446,7 +503,9 @@ fn test_error_reporting() {
 
     // NUL error
     let mut query = stmt!("SELECT ? from system_schema.tables;");
-    let err = query.bind(0, "safe\0nasty!").expect_err("Should have failed!");
+    let err = query
+        .bind(0, "safe\0nasty!")
+        .expect_err("Should have failed!");
     println!("Got error {} kind {:?}", err, err.kind());
     match *err.kind() {
         ErrorKind::StringContainsNul(_) => (),
@@ -467,9 +526,7 @@ fn test_result() {
 #[test]
 fn test_statement_timeout() {
     let mut query = stmt!("SELECT * FROM system_schema.tables;");
-    query.set_statement_request_timeout(Some(Duration::milliseconds(
-        30000 as i64,
-    )));
+    query.set_statement_request_timeout(Some(Duration::milliseconds(30000 as i64)));
     let session = help::create_test_session();
     let result = session.execute(&query).wait().unwrap();
 
diff --git a/tests/batch.rs b/tests/batch.rs
index cfbbeae..a3b348d 100644
--- a/tests/batch.rs
+++ b/tests/batch.rs
@@ -1,20 +1,18 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
 use std::collections::HashSet;
-use futures::Future;
-
 
-#[derive(Debug,Eq,PartialEq,Hash)]
+#[derive(Debug, Eq, PartialEq, Hash)]
 struct Pair {
     key: String,
     value: String,
 }
 
-fn insert_into_batch_with_prepared(session: &Session, pairs: &Vec<Pair>) -> Result<PreparedStatement> {
+fn insert_into_batch_with_prepared(
+    session: &Session,
+    pairs: &Vec<Pair>,
+) -> Result<PreparedStatement> {
     let insert_query = "INSERT INTO examples.pairs (key, value) VALUES (?, ?)";
     let prepared = session.prepare(insert_query).unwrap().wait().unwrap();
     let mut batch = Batch::new(BatchType::LOGGED);
@@ -36,25 +34,39 @@ fn retrieve_batch(session: &Session) -> Vec<Pair> {
     let select_query = stmt!("SELECT * from examples.pairs");
 
     let result = session.execute(&select_query).wait().unwrap();
-    let v: Vec<Pair> = result.iter().map(|r| {
-        Pair {
+    let v: Vec<Pair> = result
+        .iter()
+        .map(|r| Pair {
             key: r.get(0).expect("Key"),
             value: r.get(1).expect("Value"),
-        }
-    }).collect();
+        })
+        .collect();
     v
 }
 
 #[test]
 fn test_batch() {
-    let create_table = "CREATE TABLE IF NOT EXISTS examples.pairs (key text, value text, PRIMARY KEY (key));";
+    let create_table =
+        "CREATE TABLE IF NOT EXISTS examples.pairs (key text, value text, PRIMARY KEY (key));";
 
-    let pairs = vec!(
-        Pair{key:"a".to_string(), value:"1".to_string()},
-        Pair{key:"b".to_string(), value:"2".to_string()},
-        Pair{key:"c".to_string(), value:"3".to_string()},
-        Pair{key:"d".to_string(), value:"4".to_string()},
-    );
+    let pairs = vec![
+        Pair {
+            key: "a".to_string(),
+            value: "1".to_string(),
+        },
+        Pair {
+            key: "b".to_string(),
+            value: "2".to_string(),
+        },
+        Pair {
+            key: "c".to_string(),
+            value: "3".to_string(),
+        },
+        Pair {
+            key: "d".to_string(),
+            value: "4".to_string(),
+        },
+    ];
 
     let session = help::create_test_session();
     help::create_example_keyspace(&session);
diff --git a/tests/bind_by_name.rs b/tests/bind_by_name.rs
index 27fafc7..a299ec0 100644
--- a/tests/bind_by_name.rs
+++ b/tests/bind_by_name.rs
@@ -1,24 +1,19 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
-use futures::Future;
-
 
 #[test]
 fn test_bind_by_name() {
-
     let keyspace = "system_schema";
     let table = "tables";
 
     let session = help::create_test_session();
 
-    let query = format!("select column_name, type from system_schema.columns where keyspace_name = '{}' and \
-                         table_name = '{}'",
-                        keyspace,
-                        table);
+    let query = format!(
+        "select column_name, type from system_schema.columns where keyspace_name = '{}' and \
+         table_name = '{}'",
+        keyspace, table
+    );
     let schema_query = Statement::new(&query, 0);
     for _ in 0..1000 {
         let result = session.execute(&schema_query).wait().unwrap();
diff --git a/tests/collections.rs b/tests/collections.rs
index 9bb60e3..3a9e35c 100644
--- a/tests/collections.rs
+++ b/tests/collections.rs
@@ -1,14 +1,13 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
 use std::collections::HashSet;
-use futures::Future;
-
 
-fn insert_into_collections(session: &Session, key: &str, items: &Vec<String>) -> Result<CassResult> {
+fn insert_into_collections(
+    session: &Session,
+    key: &str,
+    items: &Vec<String>,
+) -> Result<CassResult> {
     let mut statement = stmt!("INSERT INTO examples.collections (key, items) VALUES (?, ?);");
     statement.bind(0, key)?;
     let mut set = Set::new(2);
@@ -44,10 +43,17 @@ fn select_from_collections(session: &Session, key: &str) -> Result<Vec<String>>
 
 #[test]
 fn test_collections() {
-    let create_table = stmt!("CREATE TABLE IF NOT EXISTS examples.collections (key text, items set<text>, PRIMARY \
-                              KEY (key))");
+    let create_table = stmt!(
+        "CREATE TABLE IF NOT EXISTS examples.collections (key text, items set<text>, PRIMARY \
+         KEY (key))"
+    );
 
-    let items = vec!["apple".to_string(), "orange".to_string(), "banana".to_string(), "mango".to_string()];
+    let items = vec![
+        "apple".to_string(),
+        "orange".to_string(),
+        "banana".to_string(),
+        "mango".to_string(),
+    ];
 
     let session = help::create_test_session();
     help::create_example_keyspace(&session);
diff --git a/tests/futures.rs b/tests/futures.rs
index 0123165..f9b4669 100644
--- a/tests/futures.rs
+++ b/tests/futures.rs
@@ -1,24 +1,25 @@
 //! Test use of Rust futures (not ResultFuture etc).
 //! Based on `async`.
 
-extern crate cassandra_cpp;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
-use futures::Future;
-
 
 static NUM_CONCURRENT_REQUESTS: usize = 1000;
 
-fn insert_into_async(session: &Session, key: String, count: usize) -> Result<Vec<CassFuture<CassResult>>> {
+fn insert_into_async(
+    session: &Session,
+    key: String,
+    count: usize,
+) -> Result<Vec<CassFuture<CassResult>>> {
     let mut futures = Vec::<CassFuture<CassResult>>::new();
     for i in 0..count {
         let key: &str = &(key.clone() + &i.to_string());
-        let mut statement = stmt!("INSERT INTO examples.async (key, bln, flt, dbl, i32, i64)
+        let mut statement = stmt!(
+            "INSERT INTO examples.async (key, bln, flt, dbl, i32, i64)
         	VALUES (?, ?, \
-                                   ?, ?, ?, ?);");
+                                   ?, ?, ?, ?);"
+        );
 
         statement.bind(0, key)?;
         statement.bind(1, i % 2 == 0)?;
@@ -34,51 +35,58 @@ fn insert_into_async(session: &Session, key: String, count: usize) -> Result<Vec
 }
 
 /// Smoke-test the implementation of Rust futures.
-#[test]
-pub fn test_rust_futures() {
+#[tokio::test]
+pub async fn test_rust_futures() {
     let session = help::create_test_session();
     help::create_example_keyspace(&session);
 
-    let create_table = session.execute(
-        &stmt!("CREATE TABLE IF NOT EXISTS examples.async(key text, bln boolean, flt float, dbl \
-                         double, i32 int, i64 bigint, PRIMARY KEY (key));"));
-    let use_examples = session.execute(&stmt!("USE examples"));
+    session
+        .execute(&stmt!(
+            "CREATE TABLE IF NOT EXISTS examples.async(key text, bln boolean, flt float, dbl \
+             double, i32 int, i64 bigint, PRIMARY KEY (key));"
+        ))
+        .await
+        .unwrap();
+
+    session.execute(&stmt!("USE examples")).await.unwrap();
     let inserts = insert_into_async(&session, "test".to_owned(), NUM_CONCURRENT_REQUESTS).unwrap();
 
-    create_table
-        .and_then(move |_| use_examples)
-        .and_then(move |_| futures::future::join_all(inserts))
-        .wait()
+    futures::future::try_join_all(inserts)
+        .await
         .expect("Should succeed");
 }
 
 /// Test early drops of Rust futures (a buggy implementation would lead to SIGSEGV, SIGILL,
 /// SIGABRT and friends).
-#[test]
-pub fn test_early_drop_rust_futures() {
+#[tokio::test]
+pub async fn test_early_drop_rust_futures() {
     let session = help::create_test_session();
     help::create_example_keyspace(&session);
 
-    let big_future = {
-        let create_table = session.execute(
-            &stmt!("CREATE TABLE IF NOT EXISTS examples.async(key text, bln boolean, flt float, dbl \
-                         double, i32 int, i64 bigint, PRIMARY KEY (key));"));
-        let use_examples = session.execute(&stmt!("USE examples"));
-        let mut inserts = insert_into_async(&session, "test".to_owned(), NUM_CONCURRENT_REQUESTS).unwrap();
+    let big_future = async {
+        session
+            .execute(&stmt!(
+                "CREATE TABLE IF NOT EXISTS examples.async(key text, bln boolean, flt float, dbl \
+                 double, i32 int, i64 bigint, PRIMARY KEY (key));"
+            ))
+            .await?;
+        session.execute(&stmt!("USE examples")).await?;
+        let mut inserts =
+            insert_into_async(&session, "test".to_owned(), NUM_CONCURRENT_REQUESTS).unwrap();
         // Put in reverse, so we poll the later ones (which won't be ready) before the earlier ones
         // (which will be immediately ready)
         inserts.reverse();
-
-        create_table
-            .and_then(move |_| use_examples)
-            .and_then(move |_| futures::future::select_all(inserts).map_err(|(e, _, _)| e))
-            // Wait for one of them to complete, and drop all the other in-flight ones.
+        // Wait for one of them to complete, and drop all the other in-flight ones.
+        let (first_result, _, _) = futures::future::select_all(inserts).await;
+        first_result
     };
-    big_future.wait().expect("Should succeed");
 
-    let more_inserts = insert_into_async(&session, "test".to_owned(), NUM_CONCURRENT_REQUESTS).unwrap();
+    big_future.await.expect("Should succeed");
+
+    let more_inserts =
+        insert_into_async(&session, "test".to_owned(), NUM_CONCURRENT_REQUESTS).unwrap();
 
-    futures::future::join_all(more_inserts)
-        .wait()
+    futures::future::try_join_all(more_inserts)
+        .await
         .expect("Should succeed");
 }
diff --git a/tests/help/mod.rs b/tests/help/mod.rs
index bf3a553..898cf32 100644
--- a/tests/help/mod.rs
+++ b/tests/help/mod.rs
@@ -4,9 +4,6 @@
 
 use cassandra_cpp::*;
 
-use futures::Future;
-
-
 /// Get a new session to the test Cassandra instance.
 pub fn create_test_session() -> Session {
     let contact_points = "127.0.0.1";
@@ -20,8 +17,9 @@ pub fn create_test_session() -> Session {
 
 /// Create the keyspace for testing.
 pub fn create_example_keyspace(session: &Session) {
-    let ks_statement = &stmt!("CREATE KEYSPACE IF NOT EXISTS examples WITH replication = { \'class\': \
-                               \'SimpleStrategy\', \'replication_factor\': \'1\' };");
+    let ks_statement = &stmt!(
+        "CREATE KEYSPACE IF NOT EXISTS examples WITH replication = { \'class\': \
+         \'SimpleStrategy\', \'replication_factor\': \'1\' };"
+    );
     session.execute(ks_statement).wait().unwrap();
 }
-
diff --git a/tests/logging.rs b/tests/logging.rs
index 88e72b7..c2ef626 100644
--- a/tests/logging.rs
+++ b/tests/logging.rs
@@ -1,16 +1,10 @@
-extern crate cassandra_cpp;
-extern crate slog;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
 
+use slog::*;
 use std::sync::Arc;
 use std::sync::Mutex;
-use slog::*;
-use futures::Future;
-
 
 /// Simple drain which accumulates all messages written to it.
 #[derive(Clone)]
@@ -26,8 +20,15 @@ impl Drain for MyDrain {
     type Ok = ();
     type Err = ();
 
-    fn log(&self, record: &Record, _values: &OwnedKVList) -> ::std::result::Result<Self::Ok, Self::Err> {
-        self.0.lock().unwrap().push_str(&format!("{}", record.msg()));
+    fn log(
+        &self,
+        record: &Record,
+        _values: &OwnedKVList,
+    ) -> ::std::result::Result<Self::Ok, Self::Err> {
+        self.0
+            .lock()
+            .unwrap()
+            .push_str(&format!("{}", record.msg()));
         Ok(())
     }
 }
@@ -41,11 +42,16 @@ fn test_logging() {
     set_logger(Some(logger));
 
     let mut cluster = Cluster::default();
-    cluster.set_contact_points("absolute-gibberish.invalid").unwrap();
+    cluster
+        .set_contact_points("absolute-gibberish.invalid")
+        .unwrap();
     cluster.connect().expect_err("Should fail to connect");
 
     let log_output: String = drain.0.lock().unwrap().clone();
-    assert!(log_output.contains("Unable to resolve address for absolute-gibberish.invalid"), log_output);
+    assert!(
+        log_output.contains("Unable to resolve address for absolute-gibberish.invalid"),
+        log_output
+    );
 }
 
 #[test]
@@ -55,17 +61,23 @@ fn test_metrics() {
     // (minimum time to respond to a request in microseconds), i.e. a request that make cassandra
     // take more than 1 microsecond to respond to. Do a couple of setup queries, with IF NOT EXISTS
     // so that they don't fail if this test is repeated.
-    let query1 = stmt!("CREATE KEYSPACE IF NOT EXISTS cycling WITH REPLICATION = {
+    let query1 = stmt!(
+        "CREATE KEYSPACE IF NOT EXISTS cycling WITH REPLICATION = {
                       'class' : 'SimpleStrategy',
                       'replication_factor' : 1
-                      };");
-    let query2 = stmt!("CREATE TABLE IF NOT EXISTS cycling.cyclist_name (
+                      };"
+    );
+    let query2 = stmt!(
+        "CREATE TABLE IF NOT EXISTS cycling.cyclist_name (
                        id UUID PRIMARY KEY,
                        lastname text,
-                       firstname text );"); //create table
-    let query3 = stmt!("INSERT INTO cycling.cyclist_name (id, lastname, firstname)
+                       firstname text );"
+    ); //create table
+    let query3 = stmt!(
+        "INSERT INTO cycling.cyclist_name (id, lastname, firstname)
                        VALUES (6ab09bec-e68e-48d9-a5f8-97e6fb4c9b47, 'KRUIKSWIJK','Steven')
-                       USING TTL 86400 AND TIMESTAMP 123456789;");
+                       USING TTL 86400 AND TIMESTAMP 123456789;"
+    );
 
     let session = help::create_test_session();
     session.execute(&query1).wait().unwrap();
diff --git a/tests/maps.rs b/tests/maps.rs
index b708100..d7b310b 100644
--- a/tests/maps.rs
+++ b/tests/maps.rs
@@ -1,21 +1,17 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
 use std::collections::HashSet;
-use futures::Future;
-
 
-#[derive(Debug,Eq,PartialEq,Hash)]
+#[derive(Debug, Eq, PartialEq, Hash)]
 struct Pair {
     key: String,
     value: i32,
 }
 
-static CREATE_TABLE: &'static str = "CREATE TABLE IF NOT EXISTS examples.maps (key text, items map<text, int>, \
-                                     PRIMARY KEY (key))";
+static CREATE_TABLE: &'static str =
+    "CREATE TABLE IF NOT EXISTS examples.maps (key text, items map<text, int>, \
+     PRIMARY KEY (key))";
 static SELECT_QUERY: &'static str = "SELECT items FROM examples.maps WHERE key = ?";
 
 fn insert_into_maps(session: &Session, key: &str, items: &Vec<Pair>) -> Result<()> {
@@ -57,22 +53,24 @@ fn test_maps() {
     let session = help::create_test_session();
     help::create_example_keyspace(&session);
 
-    let items: Vec<Pair> = vec![Pair {
-                                    key: "apple".to_string(),
-                                    value: 1,
-                                },
-                                Pair {
-                                    key: "orange".to_string(),
-                                    value: 2,
-                                },
-                                Pair {
-                                    key: "banana".to_string(),
-                                    value: 3,
-                                },
-                                Pair {
-                                    key: "mango".to_string(),
-                                    value: 4,
-                                }];
+    let items: Vec<Pair> = vec![
+        Pair {
+            key: "apple".to_string(),
+            value: 1,
+        },
+        Pair {
+            key: "orange".to_string(),
+            value: 2,
+        },
+        Pair {
+            key: "banana".to_string(),
+            value: 3,
+        },
+        Pair {
+            key: "mango".to_string(),
+            value: 4,
+        },
+    ];
 
     session.execute(&stmt!(CREATE_TABLE)).wait().unwrap();
     insert_into_maps(&session, "test", &items).unwrap();
diff --git a/tests/paging.rs b/tests/paging.rs
index 3017f67..85f384e 100644
--- a/tests/paging.rs
+++ b/tests/paging.rs
@@ -1,22 +1,20 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
-use futures::Future;
-
 
 static NUM_CONCURRENT_REQUESTS: usize = 100;
 const PAGE_SIZE: i32 = 10;
 
-static CREATE_TABLE: &'static str = "CREATE TABLE IF NOT EXISTS examples.paging (key ascii, value text, PRIMARY KEY \
-                                     (key));";
+static CREATE_TABLE: &'static str =
+    "CREATE TABLE IF NOT EXISTS examples.paging (key ascii, value text, PRIMARY KEY \
+     (key));";
 static SELECT_QUERY: &'static str = "SELECT * FROM paging";
 static INSERT_QUERY: &'static str = "INSERT INTO paging (key, value) VALUES (?, ?);";
 
 // FIXME uuids not yet working
-fn insert_into_paging(session: &Session /* , uuid_gen:&mut UuidGen */) -> Result<Vec<Option<CassFuture<CassResult>>>> {
+fn insert_into_paging(
+    session: &Session, /* , uuid_gen:&mut UuidGen */
+) -> Result<Vec<Option<CassFuture<CassResult>>>> {
     let mut futures = Vec::with_capacity(NUM_CONCURRENT_REQUESTS as usize);
     let mut results = Vec::with_capacity(NUM_CONCURRENT_REQUESTS as usize);
 
@@ -51,9 +49,7 @@ fn select_from_paging(session: &Session) -> Result<Vec<(String, String)>> {
                 Ok(key) => {
                     let key_str = key.to_string();
                     let value = row.get_column(1)?.get_string()?;
-                    println!("key: '{:?}' value: '{:?}'",
-                             &key_str,
-                             &value);
+                    println!("key: '{:?}' value: '{:?}'", &key_str, &value);
                     res.push((key_str, value));
                 }
                 Err(err) => panic!(err),
@@ -80,7 +76,7 @@ fn test_paging() {
     for result in results {
         print!("{:?}", result.unwrap().wait().unwrap());
     }
-    let mut results: Vec<(String,String)> = select_from_paging(&session).unwrap();
+    let mut results: Vec<(String, String)> = select_from_paging(&session).unwrap();
     results.sort_by_key(|kv| kv.0.clone());
     results.dedup_by_key(|kv| kv.0.clone());
     assert_eq!(results.len(), NUM_CONCURRENT_REQUESTS);
diff --git a/tests/types.rs b/tests/types.rs
index 50881eb..6903ded 100644
--- a/tests/types.rs
+++ b/tests/types.rs
@@ -1,11 +1,7 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
 
-
 #[test]
 fn test_using_consistency() {
     let mut s = stmt!("select 1+1;");
@@ -15,7 +11,9 @@ fn test_using_consistency() {
     let mut batch = Batch::new(BatchType::LOGGED);
     batch.add_statement(&s).unwrap();
     batch.set_consistency(Consistency::TWO).unwrap();
-    batch.set_serial_consistency(Consistency::LOCAL_SERIAL).unwrap();
+    batch
+        .set_serial_consistency(Consistency::LOCAL_SERIAL)
+        .unwrap();
 }
 
 #[test]
@@ -33,7 +31,9 @@ fn test_parsing_printing_consistency() {
     assert_eq!(Consistency::LOCAL_QUORUM.to_string(), "LOCAL_QUORUM");
     assert_eq!(format!("{}", Consistency::LOCAL_QUORUM), "LOCAL_QUORUM");
     assert_eq!("THREE".parse::<Consistency>().unwrap(), Consistency::THREE);
-    let _ = "INVALID".parse::<Consistency>().expect_err("Should have failed to parse");
+    let _ = "INVALID"
+        .parse::<Consistency>()
+        .expect_err("Should have failed to parse");
 }
 
 #[test]
@@ -58,7 +58,9 @@ fn test_parsing_printing_loglevel() {
     assert_eq!(LogLevel::INFO.to_string(), "INFO");
     assert_eq!(format!("{}", LogLevel::WARN), "WARN");
     assert_eq!("ERROR".parse::<LogLevel>().unwrap(), LogLevel::ERROR);
-    let _ = "INVALID".parse::<LogLevel>().expect_err("Should have failed to parse");
+    let _ = "INVALID"
+        .parse::<LogLevel>()
+        .expect_err("Should have failed to parse");
 }
 
 #[test]
@@ -67,7 +69,10 @@ fn test_using_ssl_verify_flags() {
     ssl.set_verify_flags(&vec![]);
     ssl.set_verify_flags(&vec![SslVerifyFlag::NONE]);
     ssl.set_verify_flags(&vec![SslVerifyFlag::PEER_CERT]);
-    ssl.set_verify_flags(&vec![SslVerifyFlag::PEER_IDENTITY_DNS, SslVerifyFlag::PEER_CERT]);
+    ssl.set_verify_flags(&vec![
+        SslVerifyFlag::PEER_IDENTITY_DNS,
+        SslVerifyFlag::PEER_CERT,
+    ]);
 }
 
 #[test]
@@ -80,10 +85,18 @@ fn test_parsing_printing_ssl_verify_flags() {
 
     // Just a few spot checks to confirm the formatting hasn't regressed
     // or changed unexpectedly.
-    assert_eq!(SslVerifyFlag::PEER_IDENTITY_DNS.to_string(), "PEER_IDENTITY_DNS");
+    assert_eq!(
+        SslVerifyFlag::PEER_IDENTITY_DNS.to_string(),
+        "PEER_IDENTITY_DNS"
+    );
     assert_eq!(format!("{}", SslVerifyFlag::PEER_CERT), "PEER_CERT");
-    assert_eq!("NONE".parse::<SslVerifyFlag>().unwrap(), SslVerifyFlag::NONE);
-    let _ = "INVALID".parse::<SslVerifyFlag>().expect_err("Should have failed to parse");
+    assert_eq!(
+        "NONE".parse::<SslVerifyFlag>().unwrap(),
+        SslVerifyFlag::NONE
+    );
+    let _ = "INVALID"
+        .parse::<SslVerifyFlag>()
+        .expect_err("Should have failed to parse");
 }
 
 #[test]
@@ -107,5 +120,7 @@ fn test_parsing_printing_batch_type() {
     assert_eq!(BatchType::LOGGED.to_string(), "LOGGED");
     assert_eq!(format!("{}", BatchType::UNLOGGED), "UNLOGGED");
     assert_eq!("COUNTER".parse::<BatchType>().unwrap(), BatchType::COUNTER);
-    let _ = "INVALID".parse::<BatchType>().expect_err("Should have failed to parse");
+    let _ = "INVALID"
+        .parse::<BatchType>()
+        .expect_err("Should have failed to parse");
 }
diff --git a/tests/uuids.rs b/tests/uuids.rs
index 94604cf..7d5e5e7 100644
--- a/tests/uuids.rs
+++ b/tests/uuids.rs
@@ -1,17 +1,13 @@
-extern crate cassandra_cpp;
-extern crate futures;
-
 mod help;
 
 use cassandra_cpp::*;
-use futures::Future;
-
 
 static TRUNCATE_QUERY: &'static str = "TRUNCATE examples.log;";
 static INSERT_QUERY: &'static str = "INSERT INTO examples.log (key, time, entry) VALUES (?, ?, ?);";
 static SELECT_QUERY: &'static str = "SELECT * FROM examples.log WHERE key = ?";
-static CREATE_TABLE: &'static str = "CREATE TABLE IF NOT EXISTS examples.log (key text, time timeuuid, entry text, \
-                                     PRIMARY KEY (key, time));";
+static CREATE_TABLE: &'static str =
+    "CREATE TABLE IF NOT EXISTS examples.log (key text, time timeuuid, entry text, \
+     PRIMARY KEY (key, time));";
 
 fn insert_into_log(session: &Session, key: &str, time: Uuid, entry: &str) -> Result<CassResult> {
     let mut statement = stmt!(INSERT_QUERY);
@@ -28,11 +24,13 @@ fn select_from_log(session: &Session, key: &str) -> Result<Vec<(Uuid, String)>>
     let future = session.execute(&statement);
     let results = future.wait();
     results.map(|r| {
-        r.iter().map(|r| {
-            let t: Uuid = r.get_column(1).expect("time0").get_uuid().expect("time");
-            let e: String = r.get(2).expect("entry");
-            (t, e)
-        }).collect()
+        r.iter()
+            .map(|r| {
+                let t: Uuid = r.get_column(1).expect("time0").get_uuid().expect("time");
+                let e: String = r.get(2).expect("entry");
+                (t, e)
+            })
+            .collect()
     })
 }