Replace matches crate with assert_matches

This commit is contained in:
Jonas Platte 2022-05-24 18:07:29 +02:00
parent f3dad1ab1f
commit b34bfaf1f6
No known key found for this signature in database
GPG Key ID: AAA7A61F696C3E0C
63 changed files with 64 additions and 64 deletions

View File

@ -27,5 +27,5 @@ serde_json = "1.0.61"
tracing = { version = "0.1.25", optional = true }
[dev-dependencies]
matches = "0.1.8"
assert_matches = "1.5.0"
serde_yaml = "0.8.17"

View File

@ -1,4 +1,4 @@
use matches::assert_matches;
use assert_matches::assert_matches;
use ruma_appservice_api::Registration;
#[test]

View File

@ -38,4 +38,4 @@ serde = { version = "1.0.118", features = ["derive"] }
serde_json = "1.0.61"
[dev-dependencies]
matches = "0.1.8"
assert_matches = "1.5.0"

View File

@ -475,7 +475,7 @@ can_be_empty!(IncomingRoomFilter);
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{

View File

@ -57,7 +57,7 @@ pub mod v3 {
#[cfg(all(test, any(feature = "client", feature = "server")))]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
#[cfg(feature = "server")]
#[test]

View File

@ -56,7 +56,7 @@ pub mod v3 {
#[cfg(all(test, any(feature = "client", feature = "server")))]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
#[cfg(feature = "client")]
#[test]

View File

@ -109,7 +109,7 @@ pub mod v3 {
#[cfg(all(test, feature = "server"))]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use ruma_common::api::IncomingRequest as _;
use super::{IncomingRequest, MembershipEventFilter};

View File

@ -78,7 +78,7 @@ pub mod v3 {
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use ruma_common::{thirdparty::Medium, user_id};
use serde_json::{from_value as from_json_value, json};

View File

@ -80,7 +80,7 @@ pub mod v3 {
#[cfg(test)]
mod test {
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json};
use super::RoomMember;

View File

@ -84,7 +84,7 @@ pub mod v3 {
#[cfg(all(test, feature = "server"))]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use ruma_common::api::IncomingRequest as _;
use super::IncomingRequest;

View File

@ -285,7 +285,7 @@ pub mod v3 {
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use serde::{Deserialize, Serialize};
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};

View File

@ -320,7 +320,7 @@ pub mod v3 {
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json};
use super::{IncomingLoginInfo, IncomingPassword, IncomingToken};

View File

@ -612,8 +612,8 @@ pub mod v3 {
#[cfg(test)]
mod tests {
use assert_matches::assert_matches;
use assign::assign;
use matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::Timeline;
@ -675,7 +675,7 @@ pub mod v3 {
mod server_tests {
use std::time::Duration;
use matches::assert_matches;
use assert_matches::assert_matches;
use ruma_common::{api::IncomingRequest as _, presence::PresenceState};
use super::{IncomingFilter, IncomingRequest};

View File

@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use assign::assign;
use matches::assert_matches;
use ruma_client_api::{
error::{ErrorBody, ErrorKind},
uiaa::{

View File

@ -74,10 +74,10 @@ wildmatch = "2.0.0"
js-sys = { version = "0.3", optional = true }
[dev-dependencies]
assert_matches = "1.5.0"
assign = "1.1.1"
http = "0.2.2"
maplit = "1.0.2"
matches = "0.1.8"
trybuild = "1.0.42"
[[bench]]

View File

@ -29,7 +29,7 @@ impl IgnoredUserListEventContent {
#[cfg(test)]
mod tests {
use crate::user_id;
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{IgnoredUserListEvent, IgnoredUserListEventContent};

View File

@ -165,7 +165,7 @@ mod tests {
use std::collections::BTreeMap;
use crate::{event_id, serde::Base64, user_id};
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{
from_value as from_json_value, json, to_value as to_json_value, Value as JsonValue,
};

View File

@ -50,7 +50,7 @@ impl KeyVerificationDoneEventContent {
#[cfg(test)]
mod tests {
use crate::event_id;
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::KeyVerificationDoneEventContent;

View File

@ -75,7 +75,7 @@ impl KeyVerificationReadyEventContent {
#[cfg(test)]
mod tests {
use crate::{event_id, OwnedDeviceId};
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{KeyVerificationReadyEventContent, ToDeviceKeyVerificationReadyEventContent};

View File

@ -200,7 +200,7 @@ mod tests {
use std::collections::BTreeMap;
use crate::{event_id, serde::Base64, user_id};
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{
from_value as from_json_value, json, to_value as to_json_value, Value as JsonValue,
};

View File

@ -80,8 +80,8 @@ impl StaticEventContent for PresenceEventContent {
#[cfg(test)]
mod tests {
use crate::{mxc_uri, presence::PresenceState, user_id};
use assert_matches::assert_matches;
use js_int::uint;
use matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{PresenceEvent, PresenceEventContent};

View File

@ -59,7 +59,7 @@ impl Relation {
#[cfg(test)]
mod tests {
use crate::event_id;
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json};
use super::{ReactionEventContent, Relation};

View File

@ -382,7 +382,7 @@ impl From<JsonWebKeyInit> for JsonWebKey {
mod tests {
use std::collections::BTreeMap;
use matches::assert_matches;
use assert_matches::assert_matches;
use serde::Deserialize;
use serde_json::{from_value as from_json_value, json};

View File

@ -87,7 +87,7 @@ fn default_room_version_id() -> RoomVersionId {
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{RoomCreateEventContent, RoomType};

View File

@ -313,8 +313,8 @@ impl From<MegolmV1AesSha2ContentInit> for MegolmV1AesSha2Content {
#[cfg(test)]
mod tests {
use crate::{event_id, serde::Raw};
use assert_matches::assert_matches;
use js_int::uint;
use matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{

View File

@ -238,7 +238,7 @@ impl<'de> Deserialize<'de> for AllowRule {
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use super::{AllowRule, JoinRule, OriginalSyncRoomJoinRulesEvent, RoomJoinRulesEventContent};
use crate::room_id;

View File

@ -458,9 +458,9 @@ impl StrippedRoomMemberEvent {
#[cfg(test)]
mod tests {
use assert_matches::assert_matches;
use js_int::uint;
use maplit::btreemap;
use matches::assert_matches;
use serde_json::{from_value as from_json_value, json};
use super::{MembershipState, RoomMemberEventContent, SignedContent, ThirdPartyInvite};

View File

@ -30,8 +30,8 @@ impl RoomNameEventContent {
mod tests {
use std::convert::TryInto;
use assert_matches::assert_matches;
use js_int::{int, uint};
use matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::RoomNameEventContent;

View File

@ -51,7 +51,7 @@ where
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use serde::{Deserialize, Serialize};
use serde_json::json;

View File

@ -136,7 +136,7 @@ pub enum SecretName {
#[cfg(test)]
mod test {
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{RequestAction, SecretName, ToDeviceSecretRequestEventContent};

View File

@ -96,8 +96,8 @@ pub enum SecretEncryptionAlgorithm {
#[cfg(test)]
mod tests {
use assert_matches::assert_matches;
use js_int::uint;
use matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{PassPhrase, SecretEncryptionAlgorithm, SecretStorageKeyEventContent};

View File

@ -44,7 +44,7 @@ pub enum SecretEncryptedData {
mod tests {
use std::collections::BTreeMap;
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use crate::serde::Base64;

View File

@ -71,8 +71,8 @@ pub struct HierarchySpaceChildEvent {
#[cfg(test)]
mod tests {
use assert_matches::assert_matches;
use js_int::uint;
use matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{HierarchySpaceChildEvent, SpaceChildEventContent};

View File

@ -499,7 +499,7 @@ impl FromStr for MatrixUri {
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use ruma_identifiers_validation::{
error::{MatrixIdError, MatrixToError, MatrixUriError},
Error,

View File

@ -474,8 +474,8 @@ impl PushFormat {
mod tests {
use std::collections::BTreeMap;
use assert_matches::assert_matches;
use js_int::{int, uint};
use matches::assert_matches;
use serde_json::{
from_value as from_json_value, json, to_value as to_json_value,
value::RawValue as RawJsonValue, Value as JsonValue,

View File

@ -170,7 +170,7 @@ mod tweak_serde {
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::{Action, Tweak};

View File

@ -312,9 +312,9 @@ mod tests {
use std::collections::BTreeMap;
use crate::{room_id, serde::Raw, user_id};
use assert_matches::assert_matches;
use js_int::{int, uint};
use maplit::btreemap;
use matches::assert_matches;
use serde_json::{
from_value as from_json_value, json, to_value as to_json_value, Value as JsonValue,
};

View File

@ -179,8 +179,8 @@ where
#[cfg(test)]
mod tests {
use assert_matches::assert_matches;
use js_int::{int, Int};
use matches::assert_matches;
use serde::Deserialize;
use super::deserialize_v1_powerlevel;

View File

@ -229,7 +229,7 @@ where
mod tests {
use std::borrow::Cow;
use matches::assert_matches;
use assert_matches::assert_matches;
use super::ValOrVec;

View File

@ -93,8 +93,8 @@ fn f64_to_uint(val: f64) -> UInt {
mod tests {
use std::time::{Duration, UNIX_EPOCH};
use assert_matches::assert_matches;
use js_int::uint;
use matches::assert_matches;
use serde::{Deserialize, Serialize};
use serde_json::json;

View File

@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use http::Method;
use matches::assert_matches;
use ruma_common::api::{
error::IntoHttpError,
select_path,

View File

@ -2,9 +2,9 @@
use std::time::Duration;
use assert_matches::assert_matches;
use assign::assign;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{MessageLikeEvent, StateEvent, SyncMessageLikeEvent, SyncStateEvent},

View File

@ -1,6 +1,6 @@
use assert_matches::assert_matches;
use js_int::uint;
use maplit::btreemap;
use matches::assert_matches;
use ruma_common::{event_id, receipt::ReceiptType, room_id, user_id, MilliSecondsSinceUnixEpoch};
use serde_json::{from_value as from_json_value, json, to_value as to_json_value};

View File

@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use js_int::{uint, UInt};
use matches::assert_matches;
use ruma_common::{
event_id, events::MessageLikeEvent, room_id, user_id, MilliSecondsSinceUnixEpoch,
};

View File

@ -1,8 +1,8 @@
#![cfg(feature = "unstable-msc3551")]
use assert_matches::assert_matches;
use assign::assign;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -1,8 +1,8 @@
#![cfg(feature = "unstable-msc3552")]
use assert_matches::assert_matches;
use assign::assign;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -1,6 +1,6 @@
use std::convert::TryFrom;
use matches::assert_matches;
use assert_matches::assert_matches;
use ruma_common::{
events::{AnyInitialStateEvent, InitialStateEvent},
RoomName,

View File

@ -1,8 +1,8 @@
#![cfg(feature = "unstable-msc3488")]
use assert_matches::assert_matches;
use assign::assign;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -2,9 +2,9 @@
use std::convert::TryFrom;
use assert_matches::assert_matches;
use assign::assign;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -1,6 +1,6 @@
use assert_matches::assert_matches;
use assign::assign;
use js_int::{uint, UInt};
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use assign::assign;
use matches::assert_matches;
use ruma_common::{
event_id,
events::room::message::{InReplyTo, MessageType, Relation, RoomMessageEventContent},

View File

@ -1,9 +1,9 @@
use std::borrow::Cow;
use assert_matches::assert_matches;
#[cfg(not(feature = "unstable-msc1767"))]
use assign::assign;
use js_int::uint;
use matches::assert_matches;
#[cfg(not(feature = "unstable-msc1767"))]
use ruma_common::events::room::message::InReplyTo;
#[cfg(any(feature = "unstable-msc2676", not(feature = "unstable-msc1767")))]

View File

@ -1,6 +1,6 @@
use assert_matches::assert_matches;
use assign::assign;
use js_int::{uint, UInt};
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -2,9 +2,9 @@
use std::time::Duration;
use assert_matches::assert_matches;
use assign::assign;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -2,9 +2,9 @@
use std::time::Duration;
use assert_matches::assert_matches;
use assign::assign;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{
event_id,
events::{

View File

@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use form_urlencoded::Serializer as Encoder;
use matches::assert_matches;
use ruma_common::serde::urlencoded;
use serde::Deserialize;

View File

@ -1,5 +1,5 @@
use assert_matches::assert_matches;
use form_urlencoded::Serializer as Encoder;
use matches::assert_matches;
use ruma_common::serde::urlencoded::{self, ser::Error};
use serde::Serialize;

View File

@ -31,5 +31,5 @@ serde = { version = "1.0.118", features = ["derive"] }
serde_json = "1.0.61"
[dev-dependencies]
assert_matches = "1.5.0"
http = "0.2.2"
matches = "0.1.8"

View File

@ -70,7 +70,7 @@ where
#[cfg(not(feature = "unstable-pre-spec"))]
#[cfg(test)]
mod tests {
use matches::assert_matches;
use assert_matches::assert_matches;
use serde_json::{json, to_value as to_json_value};
use super::{deserialize, serialize};

View File

@ -318,8 +318,8 @@ impl SigningKeyUpdateContent {
#[cfg(test)]
mod test {
use assert_matches::assert_matches;
use js_int::uint;
use matches::assert_matches;
use ruma_common::{room_id, user_id};
use serde_json::json;