data_forms: Stop duplicating FORM_TYPE in memory.
The FORM_TYPE is now only present once, as the form_type member of the DataForm struct, it isn’t duplicated in fields anymore. This removes the need to ignore this special field in every single protocol built on XEP-0128.
This commit is contained in:
parent
a076221c9a
commit
f2c3f45a6f
4 changed files with 34 additions and 29 deletions
12
src/ibr.rs
12
src/ibr.rs
|
|
@ -207,18 +207,6 @@ mod tests {
|
|||
assert!(!query.fields["instructions"].is_empty());
|
||||
let form = query.form.clone().unwrap();
|
||||
assert!(!form.instructions.unwrap().is_empty());
|
||||
assert!(form
|
||||
.fields
|
||||
.binary_search_by(|field| field.var.cmp(&String::from("first")))
|
||||
.is_ok());
|
||||
assert!(form
|
||||
.fields
|
||||
.binary_search_by(|field| field.var.cmp(&String::from("x-gender")))
|
||||
.is_ok());
|
||||
assert!(form
|
||||
.fields
|
||||
.binary_search_by(|field| field.var.cmp(&String::from("coucou")))
|
||||
.is_err());
|
||||
let elem2 = query.into();
|
||||
assert!(elem1.compare_to(&elem2));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue