From 1c2d5dff82d7d636f0c809e037d4d4752e56e58f Mon Sep 17 00:00:00 2001 From: Joseph Livesey Date: Wed, 6 Jul 2022 20:31:58 -0400 Subject: [PATCH] fix(run_docker_test): attempt to fix build issue fix(run_docker_test): fix build issue refactor(run_docker_test): fix build issue Signed-off-by: Joseph Livesey style/(src): make clippy suggested changes Signed-off-by: Joseph Livesey fix(run_docker_test): attempt to fix build fix(run_docker_test): attempt to fix build --- bin/run_docker_test | 6 +++--- src/engine.rs | 4 ++-- src/main.rs | 13 ++++++------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/bin/run_docker_test b/bin/run_docker_test index 33b51fbaf..4aedbba58 100755 --- a/bin/run_docker_test +++ b/bin/run_docker_test @@ -80,7 +80,7 @@ def main(): inspect = [ 'docker', 'inspect', '-f', "{{.State.ExitCode}}", - "{}_{}_1".format( + "{}-{}-1".format( isolation_id, test_service) ] @@ -97,7 +97,7 @@ def main(): for service in compose_dict['services']: scrape += [ - '--filter', 'name={}_{}_1'.format(isolation_id, service), + '--filter', 'name={}-{}-1'.format(isolation_id, service), ] timer = Timer(args.timeout) @@ -310,7 +310,7 @@ def _validate_compose_dict(compose_dict, test_service, compose_file): def _check_for_existing_containers(compose_file, compose_dict, isolation_id): containers = _get_existing_containers() for service in compose_dict['services'].keys(): - container_name_to_create = "{}_{}_1".format(isolation_id, service) + container_name_to_create = "{}-{}-1".format(isolation_id, service) for existing_container_name in containers: if container_name_to_create == existing_container_name: raise RunDockerTestError( diff --git a/src/engine.rs b/src/engine.rs index ff8716c2a..309c3b4ec 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -57,7 +57,7 @@ impl DevmodeService { #[allow(clippy::ptr_arg)] fn get_block(&mut self, block_id: &BlockId) -> Block { - debug!("Getting block {}", to_hex(&block_id)); + debug!("Getting block {}", to_hex(block_id)); self.service .get_blocks(vec![block_id.clone()]) .expect("Failed to get block") @@ -164,7 +164,7 @@ impl DevmodeService { #[allow(clippy::ptr_arg)] fn send_block_ack(&mut self, sender_id: &PeerId, block_id: BlockId) { self.service - .send_to(&sender_id, "ack", block_id) + .send_to(sender_id, "ack", block_id) .expect("Failed to send block ack"); } diff --git a/src/main.rs b/src/main.rs index f656f56b9..a246fdfeb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,13 +53,12 @@ fn main() { let no_forks: bool = matches.is_present("no_forks"); - let console_log_level; - match matches.occurrences_of("verbose") { - 0 => console_log_level = LogLevelFilter::Warn, - 1 => console_log_level = LogLevelFilter::Info, - 2 => console_log_level = LogLevelFilter::Debug, - _ => console_log_level = LogLevelFilter::Trace, - } + let console_log_level = match matches.occurrences_of("verbose") { + 0 => LogLevelFilter::Warn, + 1 => LogLevelFilter::Info, + 2 => LogLevelFilter::Debug, + _ => LogLevelFilter::Trace, + }; let stdout = ConsoleAppender::builder() .encoder(Box::new(PatternEncoder::new(