Use regular builder pattern for ClientConfig::store_config

This commit is contained in:
Jonas Platte
2022-03-11 11:49:41 +01:00
parent 27ee7c32ca
commit 48660c482f
2 changed files with 7 additions and 5 deletions

View File

@@ -122,7 +122,8 @@ impl ClientConfig {
/// use matrix_sdk::{Client, config::{ClientConfig, StoreConfig}};
///
/// let store_config = StoreConfig::new().state_store(custom_state_store);
/// let client_config = ClientConfig::with_store_config(store_config)
/// let client_config = ClientConfig::new()
/// .store_config(store_config)
/// .use_discovery_response();
///
/// # Result::<_, matrix_sdk::Error>::Ok(())
@@ -130,8 +131,9 @@ impl ClientConfig {
/// ```
/// [`make_store_config`]: crate::store::make_store_config
/// [`store`]: crate::store
pub fn with_store_config(store_config: StoreConfig) -> Self {
Self { store_config, ..Default::default() }
pub fn store_config(mut self, store_config: StoreConfig) -> Self {
self.store_config = store_config;
self
}
/// Set the proxy through which all the HTTP requests should go.

View File

@@ -24,10 +24,10 @@
//! implementation for WebAssembly.
//!
//! Both options provide a `make_store_config` convenience method to create a
//! [`StoreConfig`] for [`ClientConfig::with_store_config()`].
//! [`StoreConfig`] for [`ClientConfig::store_config()`].
//!
//! [`StoreConfig`]: crate::config::StoreConfig
//! [`ClientConfig::with_store_config()`]: crate::config::ClientConfig::with_store_config()
//! [`ClientConfig::store_config()`]: crate::config::ClientConfig::store_config()
#[cfg(any(feature = "indexeddb_state_store", feature = "indexeddb_cryptostore"))]
pub use matrix_sdk_indexeddb::*;