crypto: Rename the StoreError to StoreResult.

master
Damir Jelić 2020-07-14 13:11:44 +02:00
parent 5d76fd9aac
commit 51012e632e
1 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@ use super::olm::{
use super::store::memorystore::MemoryStore; use super::store::memorystore::MemoryStore;
#[cfg(feature = "sqlite-cryptostore")] #[cfg(feature = "sqlite-cryptostore")]
use super::store::sqlite::SqliteStore; use super::store::sqlite::SqliteStore;
use super::{device::Device, store::Result as StoreError, CryptoStore}; use super::{device::Device, store::Result as StoreResult, CryptoStore};
use matrix_sdk_common::api; use matrix_sdk_common::api;
use matrix_sdk_common::events::{ use matrix_sdk_common::events::{
@ -129,7 +129,7 @@ impl OlmMachine {
user_id: UserId, user_id: UserId,
device_id: String, device_id: String,
mut store: Box<dyn CryptoStore>, mut store: Box<dyn CryptoStore>,
) -> StoreError<Self> { ) -> StoreResult<Self> {
let account = match store.load_account().await? { let account = match store.load_account().await? {
Some(a) => { Some(a) => {
debug!("Restored account"); debug!("Restored account");
@ -166,7 +166,7 @@ impl OlmMachine {
device_id: &str, device_id: &str,
path: P, path: P,
passphrase: &str, passphrase: &str,
) -> StoreError<Self> { ) -> StoreResult<Self> {
let store = let store =
SqliteStore::open_with_passphrase(&user_id, device_id, path, passphrase).await?; SqliteStore::open_with_passphrase(&user_id, device_id, path, passphrase).await?;
@ -397,7 +397,7 @@ impl OlmMachine {
async fn handle_devices_from_key_query( async fn handle_devices_from_key_query(
&mut self, &mut self,
device_keys_map: &BTreeMap<UserId, BTreeMap<DeviceId, DeviceKeys>>, device_keys_map: &BTreeMap<UserId, BTreeMap<DeviceId, DeviceKeys>>,
) -> StoreError<Vec<Device>> { ) -> StoreResult<Vec<Device>> {
let mut changed_devices = Vec::new(); let mut changed_devices = Vec::new();
for (user_id, device_map) in device_keys_map { for (user_id, device_map) in device_keys_map {
@ -1211,7 +1211,7 @@ impl OlmMachine {
/// key query. /// key query.
/// ///
/// Returns true if the user was queued up for a key query, false otherwise. /// Returns true if the user was queued up for a key query, false otherwise.
pub async fn mark_user_as_changed(&mut self, user_id: &UserId) -> StoreError<bool> { pub async fn mark_user_as_changed(&mut self, user_id: &UserId) -> StoreResult<bool> {
if self.store.tracked_users().contains(user_id) { if self.store.tracked_users().contains(user_id) {
self.store.update_tracked_user(user_id, true).await?; self.store.update_tracked_user(user_id, true).await?;
Ok(true) Ok(true)