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:
parent
7a70d96235
commit
f9b9112d07
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user