Skip to content

Commit

Permalink
[feature] #3383: Make clippy and rustfmt happy (thanks, I hate it)
Browse files Browse the repository at this point in the history
`rustfmt` wants `socket_addr!(127.0.0.1: port);` to be formatted as `socket_addr!(127.0.0 .1: port);`...

There is an option to exclude a certain macro invocations from being formatted, but

1) the config option parsing seems broken rust-lang/rustfmt#5816
2) the toolchain used in CI doesn't support it

I guess we would have to live with this ugly formatting for some time...

Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
  • Loading branch information
DCNick3 committed Jul 6, 2023
1 parent 8fc1f1c commit f9a00a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/test_network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,9 @@ impl PeerBuilder {
pub fn build(&mut self) -> Result<Peer> {
let mut peer = Peer::new()?;
if let Some(port) = self.port.take() {
peer.p2p_address = socket_addr!(127.0.0.1: port);
peer.api_address = socket_addr!(127.0.0.1: port + 1);
peer.telemetry_address = socket_addr!(127.0.0.1: port + 2);
peer.p2p_address = socket_addr!(127.0.0 .1: port);
peer.api_address = socket_addr!(127.0.0 .1: port + 1);
peer.telemetry_address = socket_addr!(127.0.0 .1: port + 2);
// prevent field desync
peer.id.address = peer.p2p_address.clone();
}
Expand Down
2 changes: 2 additions & 0 deletions primitives/derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Crate containing procedural macros for `iroha_primitives`.

mod socket_addr;

/// Convenience macro to concisely construct a `SocketAddr`
Expand Down

0 comments on commit f9a00a8

Please sign in to comment.