mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-19 14:19:06 -04:00
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:
@@ -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 {
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user