Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
NIGHTLY: nightly-2025-11-06
NIGHTLY: nightly-2026-04-17

on:
push:
Expand All @@ -26,14 +26,14 @@ jobs:
- name: Install MSRV toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.88"
toolchain: "1.89"

- uses: Swatinem/rust-cache@v2
with:
# A stable compiler update should automatically not reuse old caches.
# Add the MSRV as a stable cache key too so bumping it also gets us a
# fresh cache.
shared-key: msrv1.88
shared-key: msrv1.89

- name: Run checks
run: cargo check --all-features
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Breaking changes:

- Upgrade reqwest to 0.13.
- The `reqwest-*` cargo features were updated to match the changes upstream.
- Upgrade ruma to 0.15.0.
- Bump the MSRV to 1.89.

## 0.17.0

Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ readme = "README.md"
repository = "https://github.com/ruma/ruma-client"
version = "0.17.0"
edition = "2024"
rust-version = "1.88"
rust-version = "1.89"

[package.metadata.docs.rs]
all-features = true
Expand All @@ -21,7 +21,7 @@ ignored = [
]

[features]
client-api = ["dep:as_variant", "ruma/client-api-c"]
client-api = ["ruma/client-api-c"]

# HTTP clients
hyper = ["dep:http-body-util", "dep:hyper", "dep:hyper-util"]
Expand All @@ -36,7 +36,7 @@ reqwest-rustls = ["reqwest", "reqwest?/rustls"]
reqwest-rustls-no-provider = ["reqwest", "reqwest?/rustls-no-provider"]

[dependencies]
as_variant = { version = "1.2.0", optional = true }
as_variant = "1.2.0"
assign = "1.1.1"
async-stream = "0.3.0"
bytes = "1.0.1"
Expand All @@ -48,11 +48,11 @@ hyper-rustls = { version = "0.27.1", optional = true, default-features = false }
hyper-tls = { version = "0.6.0", optional = true }
hyper-util = { version = "0.1.3", optional = true, features = ["client-legacy", "http1", "http2", "tokio"] }
reqwest = { version = "0.13", optional = true, default-features = false }
ruma = { version = "0.14.1", features = ["api"] }
ruma = { version = "0.15.0", features = ["api"] }
tracing = { version = "0.1.30", default-features = false, features = ["std"] }

[dev-dependencies]
ruma = { version = "0.14.1", features = ["client-api-c"] }
ruma = { version = "0.15.0", features = ["client-api-c"] }
tokio-stream = "0.1.8"

[lints.rust]
Expand Down
8 changes: 4 additions & 4 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use ruma::{
account::register::{self, RegistrationKind},
session::login::{self, v3::LoginInfo},
sync::sync_events,
uiaa::UserIdentifier,
uiaa::{MatrixUserIdentifier, UserIdentifier},
},
path_builder::{PathBuilder, SinglePath, VersionHistory},
},
Expand Down Expand Up @@ -157,9 +157,9 @@ impl<C: HttpClient> Client<C> {
password: &str,
device_id: Option<&DeviceId>,
initial_device_display_name: Option<&str>,
) -> Result<login::v3::Response, Error<C::Error, ruma::api::client::Error>> {
) -> Result<login::v3::Response, Error<C::Error, ruma::api::error::Error>> {
let login_info = LoginInfo::Password(login::v3::Password::new(
UserIdentifier::UserIdOrLocalpart(user.to_owned()),
UserIdentifier::Matrix(MatrixUserIdentifier::new(user.to_owned())),
password.to_owned(),
));
let response = self
Expand Down Expand Up @@ -251,7 +251,7 @@ impl<C: HttpClient> Client<C> {
set_presence: PresenceState,
timeout: Option<Duration>,
) -> impl Stream<
Item = Result<sync_events::v3::Response, Error<C::Error, ruma::api::client::Error>>,
Item = Result<sync_events::v3::Response, Error<C::Error, ruma::api::error::Error>>,
> + '_ {
try_stream! {
loop {
Expand Down
4 changes: 2 additions & 2 deletions src/client/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl ClientBuilder {
/// Unless the supported Matrix versions were manually set via
/// [`supported_matrix_versions`][Self::supported_matrix_versions], this will do a
/// [`get_supported_versions`] request to find out about the supported versions.
pub async fn build<C>(self) -> Result<Client<C>, Error<C::Error, ruma::api::client::Error>>
pub async fn build<C>(self) -> Result<Client<C>, Error<C::Error, ruma::api::error::Error>>
where
C: DefaultConstructibleHttpClient,
{
Expand All @@ -75,7 +75,7 @@ impl ClientBuilder {
pub async fn http_client<C>(
self,
http_client: C,
) -> Result<Client<C>, Error<C::Error, ruma::api::client::Error>>
) -> Result<Client<C>, Error<C::Error, ruma::api::error::Error>>
where
C: HttpClient,
{
Expand Down
13 changes: 5 additions & 8 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

use std::fmt::{self, Debug, Display, Formatter};

use ruma::api::error::{FromHttpResponseError, IntoHttpError};
use as_variant::as_variant;
use ruma::api::error::{FromHttpResponseError, FromHttpResponseErrorExt as _, IntoHttpError};

/// An error that can occur during client operations.
#[derive(Debug)]
Expand All @@ -24,14 +25,10 @@ pub enum Error<E, F> {
FromHttpResponse(FromHttpResponseError<F>),
}

#[cfg(feature = "client-api")]
impl<E> Error<E, ruma::api::client::Error> {
impl<E> Error<E, ruma::api::error::Error> {
/// If `self` is a server error in the `errcode` + `error` format expected
/// for client-server API endpoints, returns the error kind (`errcode`).
pub fn error_kind(&self) -> Option<&ruma::api::client::error::ErrorKind> {
use as_variant::as_variant;
use ruma::api::client::error::FromHttpResponseErrorExt as _;

/// for Matrix API endpoints, returns the error kind (`errcode`).
pub fn error_kind(&self) -> Option<&ruma::api::error::ErrorKind> {
as_variant!(self, Self::FromHttpResponse)?.error_kind()
}
}
Expand Down