diff --git a/crates/matrix-sdk/src/client/builder/mod.rs b/crates/matrix-sdk/src/client/builder/mod.rs index cb67511d6..0dfe93811 100644 --- a/crates/matrix-sdk/src/client/builder/mod.rs +++ b/crates/matrix-sdk/src/client/builder/mod.rs @@ -709,19 +709,6 @@ pub enum ClientBuildError { SqliteStore(#[from] matrix_sdk_sqlite::OpenStoreError), } -impl ClientBuildError { - /// Assert that a valid homeserver URL was given to the builder and no other - /// invalid options were specified, which means the only possible error - /// case is [`Self::Http`]. - #[doc(hidden)] - pub fn assert_valid_builder_args(self) -> HttpError { - match self { - ClientBuildError::Http(e) => e, - _ => unreachable!("homeserver URL was asserted to be valid"), - } - } -} - // The http mocking library is not supported for wasm32 #[cfg(all(test, not(target_arch = "wasm32")))] pub(crate) mod tests { diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index 18c190907..9905e1584 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -386,12 +386,8 @@ impl Client { /// # Arguments /// /// * `homeserver_url` - The homeserver that the client should connect to. - pub async fn new(homeserver_url: Url) -> Result { - Self::builder() - .homeserver_url(homeserver_url) - .build() - .await - .map_err(ClientBuildError::assert_valid_builder_args) + pub async fn new(homeserver_url: Url) -> Result { + Self::builder().homeserver_url(homeserver_url).build().await } /// Returns a subscriber that publishes an event every time the ignore user