Skip to content

Commit ea0f980

Browse files
committed
Upgrade Ruma
1 parent 90ff257 commit ea0f980

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ hyper-rustls = { version = "0.27.1", optional = true, default-features = false }
4242
hyper-tls = { version = "0.6.0", optional = true }
4343
hyper-util = { version = "0.1.3", optional = true, features = ["client-legacy", "http1", "http2", "tokio"] }
4444
reqwest = { version = "0.12.4", optional = true, default-features = false }
45-
ruma = { version = "0.12.1", features = ["api"] }
45+
ruma = { version = "0.13.0", features = ["api"] }
4646
serde_html_form = "0.2.0"
4747
tracing = { version = "0.1.30", default-features = false, features = ["std"] }
4848

4949
[dev-dependencies]
50-
ruma = { version = "0.12.1", features = ["client-api-c"] }
50+
ruma = { version = "0.13.0", features = ["client-api-c"] }
5151
tokio-stream = "0.1.8"
5252

5353
[lints.rust]

src/http_client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{future::Future, pin::Pin};
55

66
use bytes::BufMut;
77
use ruma::{
8-
api::{MatrixVersion, OutgoingRequest, SendAccessToken},
8+
api::{OutgoingRequest, SendAccessToken, SupportedVersions},
99
UserId,
1010
};
1111

@@ -60,7 +60,7 @@ pub trait HttpClientExt: HttpClient {
6060
&'a self,
6161
homeserver_url: &str,
6262
access_token: SendAccessToken<'_>,
63-
for_versions: &[MatrixVersion],
63+
for_versions: &SupportedVersions,
6464
request: R,
6565
) -> Pin<Box<dyn Future<Output = ResponseResult<Self, R>> + 'a + Send>> {
6666
self.send_customized_matrix_request(
@@ -79,7 +79,7 @@ pub trait HttpClientExt: HttpClient {
7979
&'a self,
8080
homeserver_url: &str,
8181
access_token: SendAccessToken<'_>,
82-
for_versions: &[MatrixVersion],
82+
for_versions: &SupportedVersions,
8383
request: R,
8484
customize: F,
8585
) -> Pin<Box<dyn Future<Output = ResponseResult<Self, R>> + 'a + Send>>
@@ -106,7 +106,7 @@ pub trait HttpClientExt: HttpClient {
106106
&'a self,
107107
homeserver_url: &str,
108108
access_token: SendAccessToken<'_>,
109-
for_versions: &[MatrixVersion],
109+
for_versions: &SupportedVersions,
110110
user_id: &'a UserId,
111111
request: R,
112112
) -> Pin<Box<dyn Future<Output = ResponseResult<Self, R>> + 'a>> {

src/lib.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@
1313
//! # async {
1414
//! # type HttpClient = ruma_client::http_client::Dummy;
1515
//! let homeserver_url = "https://example.com".to_owned();
16-
//! let client = ruma_client::Client::builder()
17-
//! .homeserver_url(homeserver_url)
18-
//! .build::<HttpClient>()
19-
//! .await?;
16+
//! let client =
17+
//! ruma_client::Client::builder().homeserver_url(homeserver_url).build::<HttpClient>().await?;
2018
//!
21-
//! let session = client
22-
//! .log_in("@alice:example.com", "secret", None, None)
23-
//! .await?;
19+
//! let session = client.log_in("@alice:example.com", "secret", None, None).await?;
2420
//!
2521
//! // You're now logged in! Write the session to a file if you want to restore it later.
2622
//! // Then start using the API!
@@ -106,7 +102,7 @@ use std::{any::type_name, future::Future};
106102
#[doc(no_inline)]
107103
pub use ruma;
108104
use ruma::{
109-
api::{MatrixVersion, OutgoingRequest, SendAccessToken},
105+
api::{OutgoingRequest, SendAccessToken, SupportedVersions},
110106
UserId,
111107
};
112108
use tracing::{info_span, Instrument};
@@ -135,7 +131,7 @@ fn send_customized_request<'a, C, R, F>(
135131
http_client: &'a C,
136132
homeserver_url: &str,
137133
send_access_token: SendAccessToken<'_>,
138-
for_versions: &[MatrixVersion],
134+
for_versions: &SupportedVersions,
139135
request: R,
140136
customize: F,
141137
) -> impl Future<Output = ResponseResult<C, R>> + Send + 'a

0 commit comments

Comments
 (0)