Stop importing Result as StdResult

The SDK's Result aliases can optionally take the error parameter, so
there is no need to disambiguate this way.
This commit is contained in:
Jonas Platte
2022-03-09 17:56:26 +01:00
parent bc1eb9a792
commit e4289405f5
3 changed files with 9 additions and 11 deletions

View File

@@ -20,7 +20,6 @@ use std::{
collections::{BTreeMap, BTreeSet},
convert::TryFrom,
fmt,
result::Result as StdResult,
sync::Arc,
};
@@ -121,7 +120,7 @@ pub struct BaseClientConfig {
#[cfg(not(tarpaulin_include))]
impl std::fmt::Debug for BaseClientConfig {
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> StdResult<(), std::fmt::Error> {
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
fmt.debug_struct("BaseClientConfig").finish()
}
}
@@ -1120,7 +1119,7 @@ impl BaseClient {
&self,
user_id: &UserId,
device_id: &DeviceId,
) -> StdResult<Option<Device>, CryptoStoreError> {
) -> Result<Option<Device>, CryptoStoreError> {
if let Some(olm) = self.olm_machine().await {
olm.get_device(user_id, device_id).await
} else {
@@ -1175,7 +1174,7 @@ impl BaseClient {
pub async fn get_user_devices(
&self,
user_id: &UserId,
) -> StdResult<UserDevices, CryptoStoreError> {
) -> Result<UserDevices, CryptoStoreError> {
if let Some(olm) = self.olm_machine().await {
Ok(olm.get_user_devices(user_id).await?)
} else {

View File

@@ -19,7 +19,6 @@ use std::{
future::Future,
io::Read,
pin::Pin,
result::Result as StdResult,
sync::{Arc, RwLock as StdRwLock},
};
@@ -151,7 +150,7 @@ pub(crate) struct ClientInner {
#[cfg(not(tarpaulin_include))]
impl Debug for Client {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> StdResult<(), fmt::Error> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
write!(fmt, "Client")
}
}

View File

@@ -252,7 +252,7 @@ use std::{
collections::{BTreeMap, HashSet},
io::{Read, Write},
path::PathBuf,
result::Result as StdResult, iter,
iter,
};
use futures_util::stream::{self, StreamExt};
@@ -389,7 +389,7 @@ impl Client {
&self,
user_id: &UserId,
device_id: &DeviceId,
) -> StdResult<Option<Device>, CryptoStoreError> {
) -> Result<Option<Device>, CryptoStoreError> {
let device = self.base_client().get_device(user_id, device_id).await?;
Ok(device.map(|d| Device { inner: d, client: self.clone() }))
@@ -426,7 +426,7 @@ impl Client {
pub async fn get_user_devices(
&self,
user_id: &UserId,
) -> StdResult<UserDevices, CryptoStoreError> {
) -> Result<UserDevices, CryptoStoreError> {
let devices = self.base_client().get_user_devices(user_id).await?;
Ok(UserDevices { inner: devices, client: self.clone() })
@@ -467,7 +467,7 @@ impl Client {
pub async fn get_user_identity(
&self,
user_id: &UserId,
) -> StdResult<Option<crate::encryption::identities::UserIdentity>, CryptoStoreError> {
) -> Result<Option<crate::encryption::identities::UserIdentity>, CryptoStoreError> {
use crate::encryption::identities::UserIdentity;
if let Some(olm) = self.olm_machine().await {
@@ -671,7 +671,7 @@ impl Client {
&self,
path: PathBuf,
passphrase: &str,
) -> StdResult<RoomKeyImportResult, RoomKeyImportError> {
) -> Result<RoomKeyImportResult, RoomKeyImportError> {
let olm = self.olm_machine().await.ok_or(RoomKeyImportError::StoreClosed)?;
let passphrase = zeroize::Zeroizing::new(passphrase.to_owned());