Rustfmt pass, and rustfmt --check in CI"

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-10-23 01:32:41 +02:00
commit a104ebc3f6
No known key found for this signature in database
GPG key ID: DEDA74AEECA9D0F2
79 changed files with 1344 additions and 957 deletions

View file

@ -30,9 +30,7 @@ impl PresencePayload for ECaps2 {}
impl ECaps2 {
/// Create an ECaps2 element from a list of hashes.
pub fn new(hashes: Vec<Hash>) -> ECaps2 {
ECaps2 {
hashes,
}
ECaps2 { hashes }
}
}
@ -85,7 +83,13 @@ fn compute_extensions(extensions: &[DataForm]) -> Result<Vec<u8>, ()> {
}
Ok(compute_items(extensions, 0x1c, |extension| {
let mut bytes = compute_item("FORM_TYPE");
bytes.append(&mut compute_item(if let Some(ref form_type) = extension.form_type { form_type } else { unreachable!() }));
bytes.append(&mut compute_item(
if let Some(ref form_type) = extension.form_type {
form_type
} else {
unreachable!()
},
));
bytes.push(0x1e);
bytes.append(&mut compute_items(&extension.fields, 0x1d, |field| {
let mut bytes = compute_item(&field.var);