chore(bindings): Move bindings around to work around rustfmt bug
@@ -156,11 +156,9 @@ impl OlmMachine {
let device_id = device_id.into();
let runtime = Runtime::new().expect("Couldn't create a tokio runtime");
- let store = Arc::new(
- runtime
+ let store = runtime
.block_on(matrix_sdk_sled::SledCryptoStore::open(path, passphrase.as_deref()))
- .map_err(|e| {
- match e {
+ .map_err(|e| match e {
// This is a bit of an error in the sled store, the
// CryptoStore returns an `OpenStoreError` which has a
// variant for the state store. Not sure what to do about
@@ -170,16 +168,14 @@ impl OlmMachine {
matrix_sdk_crypto::store::CryptoStoreError::backend(s),
),
_ => unreachable!(),
- }
- })?,
- );
+ })?;
passphrase.zeroize();
- Ok(OlmMachine {
- inner: runtime.block_on(InnerMachine::with_store(&user_id, device_id, store))?,
- runtime,
- })
+ let inner =
+ runtime.block_on(InnerMachine::with_store(&user_id, device_id, Arc::new(store)))?;
+
+ Ok(OlmMachine { inner, runtime })
}
/// Get the display name of our own device.
