Reformat rust code using 1.40 rustfmt and fail build if rustfmt fails (#2339)
diff --git a/lib/rs/src/protocol/compact.rs b/lib/rs/src/protocol/compact.rs
index f885e40..e08a30b 100644
--- a/lib/rs/src/protocol/compact.rs
+++ b/lib/rs/src/protocol/compact.rs
@@ -427,7 +427,8 @@
self.write_byte(COMPACT_PROTOCOL_ID)?;
self.write_byte((u8::from(identifier.message_type) << 5) | COMPACT_VERSION)?;
// cast i32 as u32 so that varint writing won't use zigzag encoding
- self.transport.write_varint(identifier.sequence_number as u32)?;
+ self.transport
+ .write_varint(identifier.sequence_number as u32)?;
self.write_string(&identifier.name)?;
Ok(())
}
@@ -1091,6 +1092,7 @@
let (mut i_prot, _) = test_objects();
// signed two's complement of -1073741823 = 1100_0000_0000_0000_0000_0000_0000_0001
+ #[rustfmt::skip]
let source_bytes: [u8; 11] = [
0x82, /* protocol ID */
0x21, /* message type | protocol version */
@@ -1102,7 +1104,7 @@
0x03, /* message-name length */
0x66,
0x6F,
- 0x6F /* "foo" */,
+ 0x6F, /* "foo" */
];
i_prot.transport.set_readable_bytes(&source_bytes);