chore: Fix PR feedbacks.

This commit is contained in:
Ivan Enderlin
2023-04-27 14:16:48 +02:00
parent 5e6720b63c
commit 58bb2dc21e
3 changed files with 5 additions and 15 deletions

View File

@@ -1,7 +1,4 @@
use std::{
fmt,
sync::{Arc, RwLock},
};
use std::sync::{Arc, RwLock};
use anyhow::{anyhow, Context};
use eyeball::shared::Observable as SharedObservable;
@@ -121,12 +118,6 @@ pub struct Client {
pub(crate) sliding_sync_reset_broadcast_tx: Arc<SharedObservable<()>>,
}
impl fmt::Debug for Client {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.debug_struct("Client").field("client", &self.client).finish_non_exhaustive()
}
}
impl Client {
pub fn new(client: MatrixClient) -> Self {
let session_verification_controller: Arc<

View File

@@ -782,7 +782,7 @@ impl SlidingSync {
}
}
#[derive(Debug, Clone, uniffi::Object)]
#[derive(Clone, uniffi::Object)]
pub struct SlidingSyncBuilder {
inner: MatrixSlidingSyncBuilder,
client: Client,
@@ -804,7 +804,7 @@ impl SlidingSyncBuilder {
pub fn add_list(self: Arc<Self>, list_builder: Arc<SlidingSyncListBuilder>) -> Arc<Self> {
let mut builder = unwrap_or_clone_arc(self);
builder.inner = builder.inner.add_list(unwrap_or_clone_arc(list_builder).inner).unwrap();
builder.inner = builder.inner.add_list(unwrap_or_clone_arc(list_builder).inner);
Arc::new(builder)
}

View File

@@ -72,10 +72,9 @@ impl SlidingSyncBuilder {
/// Add the given list to the lists.
///
/// Replace any list with the name.
pub fn add_list(mut self, list_builder: SlidingSyncListBuilder) -> Result<Self> {
pub fn add_list(mut self, list_builder: SlidingSyncListBuilder) -> Self {
self.lists.push(list_builder);
Ok(self)
self
}
/// Activate e2ee, to-device-message and account data extensions if not yet