Remove all uses of unwrap from library source

This commit is contained in:
Jack Lloyd
2021-02-05 12:14:28 -05:00
parent 57b2e63f0b
commit 14060ae168
25 changed files with 488 additions and 340 deletions

View File

@@ -6,12 +6,12 @@
use libsignal_protocol::*;
use rand::{rngs::OsRng, CryptoRng, Rng};
pub fn test_in_memory_protocol_store() -> InMemSignalProtocolStore {
pub fn test_in_memory_protocol_store() -> Result<InMemSignalProtocolStore, SignalProtocolError> {
let mut csprng = OsRng;
let identity_key = IdentityKeyPair::generate(&mut csprng);
let registration_id = 5; // fixme randomly generate this
InMemSignalProtocolStore::new(identity_key, registration_id).unwrap()
InMemSignalProtocolStore::new(identity_key, registration_id)
}
#[allow(dead_code)]