crypto: Mark the Account as Send.

master
Damir Jelić 2020-03-11 11:44:45 +01:00
parent e271b17766
commit 2b389a8440
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,12 @@ impl fmt::Debug for Account {
} }
} }
/// Marking this as Send is safe because nothing will modify the pointer under
/// us from the C side. Sync on the other hand is unsafe since libolm doesn't do
/// any synchronization. We're wrapping the whole Olm machine inside a Mutex to
/// get Sync for it
unsafe impl Send for Account {}
impl Account { impl Account {
/// Create a new account. /// Create a new account.
pub fn new() -> Self { pub fn new() -> Self {