Skip to content

Commit ed14d63

Browse files
committed
fixing 0.8 builds
1 parent de75494 commit ed14d63

File tree

4 files changed

+36
-30
lines changed

4 files changed

+36
-30
lines changed

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl fmt::Display for CassError_ {
7979
}
8080

8181
impl CassError_ {
82-
pub fn to_result<T>(&self, t: T) -> Result<T> {
82+
pub fn to_result<T>(&self, t: T) -> Result<T> {
8383
use CassError_::*;
8484
match self {
8585
&CASS_OK => Ok(t),

src/examples/ssl.rs

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,34 @@ fn main() {
6969
let result_future = cass_session_execute(session, statement);
7070

7171
match cass_future_error_code(result_future) {
72-
CASS_OK => {
73-
// Retrieve result set and iterator over the rows
74-
let result = cass_future_get_result(result_future);
75-
let rows = cass_iterator_from_result(result);
76-
77-
while cass_iterator_next(rows) == cass_true {
78-
let row = cass_iterator_get_row(rows);
79-
let value = cass_row_get_column_by_name(row, CString::new("keyspace_name").unwrap().as_ptr());
80-
81-
let mut keyspace_name = mem::zeroed();
82-
let mut keyspace_name_length = mem::zeroed();
83-
cass_value_get_string(value, &mut keyspace_name, &mut keyspace_name_length);
84-
println!("keyspace_name: {:?}",
85-
raw2utf8(keyspace_name, keyspace_name_length));
72+
CASS_OK => {
73+
// Retrieve result set and iterator over the rows
74+
let result = cass_future_get_result(result_future);
75+
let rows = cass_iterator_from_result(result);
76+
77+
while cass_iterator_next(rows) == cass_true {
78+
let row = cass_iterator_get_row(rows);
79+
let value = cass_row_get_column_by_name(row,
80+
CString::new("keyspace_name").unwrap().as_ptr());
81+
82+
let mut keyspace_name = mem::zeroed();
83+
let mut keyspace_name_length = mem::zeroed();
84+
cass_value_get_string(value, &mut keyspace_name, &mut keyspace_name_length);
85+
println!("keyspace_name: {:?}",
86+
raw2utf8(keyspace_name, keyspace_name_length));
87+
}
88+
89+
cass_result_free(result);
90+
cass_iterator_free(rows);
91+
}
92+
rc => {
93+
// Handle error
94+
let mut message = mem::zeroed();
95+
let mut message_length = mem::zeroed();
96+
cass_future_error_message(result_future, &mut message, &mut message_length);
97+
println!("Unable to run query: {:?}",
98+
raw2utf8(message, message_length));
8699
}
87-
88-
cass_result_free(result);
89-
cass_iterator_free(rows);
90-
} rc => {
91-
// Handle error
92-
let mut message = mem::zeroed();
93-
let mut message_length = mem::zeroed();
94-
cass_future_error_message(result_future, &mut message, &mut message_length);
95-
println!("Unable to run query: {:?}",
96-
raw2utf8(message, message_length));
97-
}
98100
}
99101

100102
cass_statement_free(statement);

src/examples/tuple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ fn insert_into_tuple(session: &mut CassSession, uuid_gen: &mut CassUuidGen) -> R
3535

3636
let rc = cass_future_error_code(future);
3737
match cass_future_error_code(future) {
38-
CASS_OK => {},
39-
rc => print_error(future)
38+
CASS_OK => {}
39+
rc => print_error(future),
4040
}
4141

4242
cass_future_free(future);

src/ffi_util.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub unsafe fn raw2utf8(data: *const i8, length: usize) -> Result<String, Utf8Err
1414

1515
impl PartialEq for cass_bool_t {
1616
fn eq(&self, other: &cass_bool_t) -> bool {
17-
let s:bool = self.clone().into();
17+
let s: bool = self.clone().into();
1818
s == other.clone().into()
1919
}
2020
}
@@ -36,6 +36,10 @@ impl Into<bool> for cass_bool_t {
3636

3737
impl From<bool> for cass_bool_t {
3838
fn from(b: bool) -> Self {
39-
if b { cass_bool_t::cass_true } else { cass_bool_t::cass_false }
39+
if b {
40+
cass_bool_t::cass_true
41+
} else {
42+
cass_bool_t::cass_false
43+
}
4044
}
4145
}

0 commit comments

Comments
 (0)