nio-olm: Small format fixes.

master
Damir Jelić 2019-11-14 20:12:45 +01:00
parent 597e99595a
commit 0760706e58
1 changed files with 10 additions and 6 deletions

View File

@ -5,15 +5,19 @@ pub struct Account {
buffer: Vec<u8>, buffer: Vec<u8>,
} }
pub struct IdentityKeys {
ed25519: String,
curve25519: String,
}
impl Account { impl Account {
#[allow(clippy::new_without_default)] #[allow(clippy::new_without_default)]
pub fn new() -> Account { pub fn new() -> Account {
let (acc_ptr, account_data) = unsafe { let account_size = unsafe { nio_olm_sys::olm_account_size() };
let account_size = nio_olm_sys::olm_account_size();
let account_data: Vec<u8> = vec![0; account_size]; let account_data: Vec<u8> = vec![0; account_size];
let acc_ptr = nio_olm_sys::olm_account(account_data.as_ptr() as *mut _);
(acc_ptr, account_data) let acc_ptr = unsafe { nio_olm_sys::olm_account(account_data.as_ptr() as *mut _) };
};
Account { Account {
account: acc_ptr, account: acc_ptr,