Cargo.toml: Bump the dependency versions.

This commit is contained in:
Damir Jelić 2020-02-21 16:33:08 +01:00
parent 63e0191f57
commit 98da341a46
3 changed files with 35 additions and 24 deletions

View File

@ -12,17 +12,17 @@ version = "0.1.0"
[dependencies]
js_int = "0.1.2"
futures = "0.3.1"
futures = "0.3.4"
reqwest = "0.10.1"
http = "0.2.0"
async-std = "1.4.0"
ruma-api = "0.12.0"
ruma-client-api = "0.5.0"
ruma-events = "0.15.1"
async-std = "1.5.0"
ruma-api = "0.13.0"
ruma-client-api = "0.6.0"
ruma-events = "0.15.0"
log = "0.4.8"
ruma-identifiers = "0.14.1"
serde_json = "1.0.44"
serde_json = "1.0.48"
serde_urlencoded = "0.6.1"
url = "2.1.1"
@ -31,6 +31,6 @@ version = "1.0.104"
features = ["derive"]
[dev-dependencies]
tokio = { version = "0.2.9", features = ["full"] }
tokio = { version = "0.2.11", features = ["full"] }
url = "2.1.1"
mockito = "0.22.0"
mockito = "0.23.3"

View File

@ -158,7 +158,7 @@ impl SyncSettings {
}
}
use api::r0::send::send_message_event;
use api::r0::message::create_message_event;
use api::r0::session::login;
use api::r0::sync::sync_events;
@ -305,12 +305,12 @@ impl AsyncClient {
device_id: Option<S>,
) -> Result<login::Response, Error> {
let request = login::Request {
address: None,
login_type: login::LoginType::Password,
medium: None,
user: login::UserInfo::MatrixId(user.into()),
login_info: login::LoginInfo::Password {
password: password.into(),
},
device_id: device_id.map(|d| d.into()),
password: password.into(),
user: user.into(),
initial_device_display_name: None,
};
let response = self.send(request).await?;
@ -456,9 +456,10 @@ impl AsyncClient {
request: Request,
) -> Result<<Request::Response as Outgoing>::Incoming, Error>
where
Request::Incoming: TryFrom<http::Request<Vec<u8>>, Error = ruma_api::Error>,
Request::Incoming:
TryFrom<http::Request<Vec<u8>>, Error = ruma_api::error::FromHttpRequestError>,
<Request::Response as Outgoing>::Incoming:
TryFrom<http::Response<Vec<u8>>, Error = ruma_api::Error>,
TryFrom<http::Response<Vec<u8>>, Error = ruma_api::error::FromHttpResponseError>,
{
let request: http::Request<Vec<u8>> = request.try_into()?;
let url = request.uri();
@ -520,8 +521,8 @@ impl AsyncClient {
&mut self,
room_id: &str,
data: MessageEventContent,
) -> Result<send_message_event::Response, Error> {
let request = send_message_event::Request {
) -> Result<create_message_event::Response, Error> {
let request = create_message_event::Request {
room_id: RoomId::try_from(room_id).unwrap(),
event_type: EventType::RoomMessage,
txn_id: self.transaction_id().to_string(),

View File

@ -4,7 +4,8 @@ use std::error::Error as StdError;
use std::fmt::{Display, Formatter, Result as FmtResult};
use reqwest::Error as ReqwestError;
use ruma_api::Error as RumaApiError;
use ruma_api::error::FromHttpResponseError as RumaResponseError;
use ruma_api::error::IntoHttpError as RumaIntoHttpError;
use serde_json::Error as SerdeJsonError;
use serde_urlencoded::ser::Error as SerdeUrlEncodedSerializeError;
use url::ParseError;
@ -19,7 +20,8 @@ impl Display for Error {
InnerError::AuthenticationRequired => "The queried endpoint requires authentication but was called with an anonymous client.",
InnerError::Reqwest(_) => "An HTTP error occurred.",
InnerError::Uri(_) => "Provided string could not be converted into a URI.",
InnerError::RumaApi(_) => "An error occurred converting between ruma_client_api and hyper types.",
InnerError::RumaResponseError(_) => "An error occurred converting between ruma_client_api and hyper types.",
InnerError::IntoHttpError(_) => "An error occurred converting between ruma_client_api and hyper types.",
InnerError::SerdeJson(_) => "A serialization error occurred.",
InnerError::SerdeUrlEncodedSerialize(_) => "An error occurred serializing data to a query string.",
};
@ -40,7 +42,9 @@ pub(crate) enum InnerError {
/// An error when parsing a string as a URI.
Uri(ParseError),
/// An error converting between ruma_client_api types and Hyper types.
RumaApi(RumaApiError),
RumaResponseError(RumaResponseError),
/// An error converting between ruma_client_api types and Hyper types.
IntoHttpError(RumaIntoHttpError),
/// An error when serializing or deserializing a JSON value.
SerdeJson(SerdeJsonError),
/// An error when serializing a query string value.
@ -53,9 +57,15 @@ impl From<ParseError> for Error {
}
}
impl From<RumaApiError> for Error {
fn from(error: RumaApiError) -> Self {
Self(InnerError::RumaApi(error))
impl From<RumaResponseError> for Error {
fn from(error: RumaResponseError) -> Self {
Self(InnerError::RumaResponseError(error))
}
}
impl From<RumaIntoHttpError> for Error {
fn from(error: RumaIntoHttpError) -> Self {
Self(InnerError::IntoHttpError(error))
}
}