Bump Ruma for CanonicalJson property name optimizations.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-11-02 03:56:39 +00:00
parent a14556da97
commit f59d62c01c
13 changed files with 57 additions and 53 deletions

View File

@@ -68,7 +68,7 @@ impl Service {
.map_err(|e| err!(Request(InvalidParam("Thread root pdu not found: {e:?}"))))?;
if let CanonicalJsonValue::Object(unsigned) = root_pdu_json
.entry("unsigned".to_owned())
.entry("unsigned".into())
.or_insert_with(|| CanonicalJsonValue::Object(BTreeMap::default()))
{
if let Some(mut relations) = unsigned
@@ -85,7 +85,7 @@ impl Service {
let content = serde_json::to_value(relations).expect("to_value always works");
unsigned.insert(
"m.relations".to_owned(),
"m.relations".into(),
json!({ "m.thread": content })
.try_into()
.expect("thread is valid json"),
@@ -101,7 +101,7 @@ impl Service {
let content = serde_json::to_value(relations).expect("to_value always works");
unsigned.insert(
"m.relations".to_owned(),
"m.relations".into(),
json!({ "m.thread": content })
.try_into()
.expect("thread is valid json"),

View File

@@ -106,7 +106,7 @@ where
// clients can easily interpret things like membership changes
if let Some(state_key) = pdu.state_key() {
if let CanonicalJsonValue::Object(unsigned) = pdu_json
.entry("unsigned".to_owned())
.entry("unsigned".into())
.or_insert_with(|| CanonicalJsonValue::Object(BTreeMap::default()))
{
if let Ok(shortstatehash) = self
@@ -122,7 +122,7 @@ where
.await
{
unsigned.insert(
"prev_content".to_owned(),
"prev_content".into(),
CanonicalJsonValue::Object(
utils::to_canonical_object(prev_state.get_content_as_value())
.map_err(|e| {
@@ -133,11 +133,11 @@ where
),
);
unsigned.insert(
String::from("prev_sender"),
"prev_sender".into(),
CanonicalJsonValue::String(prev_state.sender().to_string()),
);
unsigned.insert(
String::from("replaces_state"),
"replaces_state".into(),
CanonicalJsonValue::String(prev_state.event_id().to_string()),
);
}