From f5a7a1bcf067c95e735c10d13d0f3ffaa457a754 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 11 Mar 2022 12:10:53 +0100 Subject: [PATCH] Rename AppService::{new_with_config => with_config} --- crates/matrix-sdk-appservice/src/lib.rs | 16 ++++++---------- crates/matrix-sdk-appservice/tests/tests.rs | 3 +-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/crates/matrix-sdk-appservice/src/lib.rs b/crates/matrix-sdk-appservice/src/lib.rs index 6d990b3df..ef4b24fec 100644 --- a/crates/matrix-sdk-appservice/src/lib.rs +++ b/crates/matrix-sdk-appservice/src/lib.rs @@ -211,7 +211,7 @@ impl AppService { /// /// Also creates and caches a [`Client`] for the [`MainUser`]. /// The default [`ClientConfig`] is used, if you want to customize it - /// use [`Self::new_with_config()`] instead. + /// use [`Self::with_config()`] instead. /// /// # Arguments /// @@ -227,20 +227,16 @@ impl AppService { server_name: impl TryInto, Error = identifiers::Error>, registration: AppServiceRegistration, ) -> Result { - let appservice = Self::new_with_config( - homeserver_url, - server_name, - registration, - ClientConfig::default(), - ) - .await?; + let appservice = + Self::with_config(homeserver_url, server_name, registration, ClientConfig::default()) + .await?; Ok(appservice) } /// Same as [`Self::new()`] but lets you provide a [`ClientConfig`] for the /// [`Client`] - pub async fn new_with_config( + pub async fn with_config( homeserver_url: impl TryInto, server_name: impl TryInto, Error = identifiers::Error>, registration: AppServiceRegistration, @@ -330,7 +326,7 @@ impl AppService { }; let client = - Client::new_with_config(self.homeserver_url.clone(), config.appservice_mode()).await?; + Client::with_config(self.homeserver_url.clone(), config.appservice_mode()).await?; let session = Session { access_token: self.registration.as_token.clone(), diff --git a/crates/matrix-sdk-appservice/tests/tests.rs b/crates/matrix-sdk-appservice/tests/tests.rs index c23f33e32..4092db182 100644 --- a/crates/matrix-sdk-appservice/tests/tests.rs +++ b/crates/matrix-sdk-appservice/tests/tests.rs @@ -35,8 +35,7 @@ async fn appservice(registration: Option) -> Result { let client_config = ClientConfig::default().request_config(RequestConfig::default().disable_retry()); - AppService::new_with_config(homeserver_url.as_ref(), server_name, registration, client_config) - .await + AppService::with_config(homeserver_url.as_ref(), server_name, registration, client_config).await } #[async_test]