common: Disable push rule matching on numbers or booleans

Spec clarification: https://github.com/matrix-org/matrix-doc/pull/3690
This commit is contained in:
Jonas Platte 2022-02-17 10:09:21 +01:00
parent 7a70d96235
commit f9b9112d07
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -291,12 +291,7 @@ impl FlattenedJson {
warn!("Duplicate path in flattened JSON: {}", path);
}
}
JsonValue::Number(_) | JsonValue::Bool(_) => {
if self.map.insert(path.clone(), value.to_string()).is_some() {
warn!("Duplicate path in flattened JSON: {}", path);
}
}
JsonValue::Array(_) | JsonValue::Null => {}
JsonValue::Number(_) | JsonValue::Bool(_) | JsonValue::Array(_) | JsonValue::Null => {}
}
}
@ -572,14 +567,7 @@ mod tests {
.unwrap();
let flattened = FlattenedJson::from_raw(&raw);
assert_eq!(
flattened.map,
btreemap! {
"string".into() => "Hello World".into(),
"number".into() => "10".into(),
"boolean".into() => "true".into(),
},
);
assert_eq!(flattened.map, btreemap! { "string".into() => "Hello World".into() });
}
#[test]