From 6c26da97a65f0173f21f9df1bde15f3cc9fc5cae Mon Sep 17 00:00:00 2001 From: Devin Ragotzy Date: Sat, 5 Dec 2020 15:47:21 -0500 Subject: [PATCH] Bump deps and remove js_int now imported from ruma --- Cargo.toml | 12 +++++------- src/event_auth.rs | 4 ++-- src/state_event.rs | 6 ++---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 77241812..8d9c8ec5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,16 +11,13 @@ license = "MIT" readme = "README.md" repository = "https://github.com/ruma/state-res" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] itertools = "0.9.0" -js_int = "0.1.9" -serde = { version = "1.0.115", features = ["derive"] } -serde_json = "1.0.57" -tracing = "0.1.19" +serde = { version = "1.0.117", features = ["derive"] } +serde_json = "1.0.60" +tracing = "0.1.22" maplit = "1.0.2" -thiserror = "1.0.20" -tracing-subscriber = "0.2.11" +thiserror = "1.0.22" [dependencies.ruma] git = "https://github.com/ruma/ruma" @@ -47,6 +44,7 @@ unstable-pre-spec = ["ruma/unstable-pre-spec"] [dev-dependencies] criterion = "0.3.3" rand = "0.7.3" +tracing-subscriber = "0.2.15" [[bench]] name = "state_res_bench" diff --git a/src/event_auth.rs b/src/event_auth.rs index c4e1b974..ee57965f 100644 --- a/src/event_auth.rs +++ b/src/event_auth.rs @@ -748,7 +748,7 @@ pub fn get_send_level( .events .get(&e_type) .cloned() - .unwrap_or_else(|| js_int::int!(50)) + .unwrap_or_else(|| ruma::int!(50)) .into(); let state_def: i64 = content.state_default.into(); let event_def: i64 = content.events_default.into(); @@ -774,7 +774,7 @@ pub fn can_send_invite( let invite_level = auth_events .get(&key) .map_or_else( - || Ok::<_, Error>(js_int::int!(50)), + || Ok::<_, Error>(ruma::int!(50)), |power_levels| { power_levels .deserialize_content::() diff --git a/src/state_event.rs b/src/state_event.rs index afea433a..141b896a 100644 --- a/src/state_event.rs +++ b/src/state_event.rs @@ -1,6 +1,5 @@ use std::{collections::BTreeMap, time::SystemTime}; -use js_int::UInt; use ruma::{ events::{ from_raw_json_value, @@ -10,7 +9,7 @@ use ruma::{ }, serde::CanonicalJsonValue, signatures::reference_hash, - EventId, RoomId, RoomVersionId, ServerName, UserId, + EventId, RoomId, RoomVersionId, ServerName, UInt, UserId, }; use serde::{de, ser, Deserialize, Serialize}; use serde_json::value::RawValue as RawJsonValue; @@ -59,6 +58,7 @@ pub struct Requester<'a> { pub sender: &'a UserId, } +// TODO: This no longer needs to be an enum now that PduStub is gone #[derive(Clone, Debug)] pub enum StateEvent { Full(EventId, Pdu), @@ -369,7 +369,6 @@ mod test { assert_eq!( match &pdu { StateEvent::Full(id, _) => id, - _ => panic!("Stub found"), }, &ruma::event_id!("$Sfx_o8eLfo4idpTO8_IGrKSPKoRMC1CmQugVw9tu_MU") ); @@ -384,7 +383,6 @@ mod test { assert_eq!( match &pdu { StateEvent::Full(id, _) => id, - _ => panic!("Stub found"), }, &ruma::event_id!("$Sfx_o8eLfo4idpTO8_IGrKSPKoRMC1CmQugVw9tu_MU") );