<commit_before>use cql_ffi::error::CassError;
use cql_ffi::session::CassSession;
use cql_bindgen::CassFuture as _CassFuture;
use cql_bindgen::cass_future_wait;
use cql_bindgen::cass_future_error_code;

pub struct SessionFuture(pub *mut _CassFuture, pub CassSession);

impl SessionFuture {
    pub fn wait(self) -> Result<CassSession,CassError> {unsafe{cass_future_wait(self.0);self.error_code()}}
    unsafe fn error_code(self) -> Result<CassSession,CassError> {CassError::build(cass_future_error_code(self.0)).wrap(self.1)}
}<commit_msg>Free the session future once it's resolved<commit_after>use cql_ffi::error::CassError;
use cql_ffi::session::CassSession;
use cql_bindgen::CassFuture as _CassFuture;
use cql_bindgen::cass_future_free;
use cql_bindgen::cass_future_wait;
use cql_bindgen::cass_future_error_code;

pub struct SessionFuture(pub *mut _CassFuture, pub CassSession);

impl SessionFuture {
    pub fn wait(self) -> Result<CassSession,CassError> {unsafe{
        cass_future_wait(self.0);
        self.error_code()
    }}
    unsafe fn error_code(self) -> Result<CassSession,CassError> {
        let code = cass_future_error_code(self.0);
        cass_future_free(self.0);
        CassError::build(code).wrap(self.1)
    }
}
{'fraction_non_alphanumeric': 0.11650485436893204, 'fraction_numerical': 0.0056634304207119745, 'mean_word_length': 6.276470588235294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3382127', 'n_tokens_mistral': 452, 'n_tokens_neox': 427, 'n_words': 76}