From 7f8116d0f89a7fe3056c83915684dba180e26b6a Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:25:19 -0700 Subject: [PATCH] Use safe unwrapping in option unwrap (#1355) --- cmd/soroban-cli/src/commands/network/start.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/soroban-cli/src/commands/network/start.rs b/cmd/soroban-cli/src/commands/network/start.rs index e4b6825ab..1d2c0645e 100644 --- a/cmd/soroban-cli/src/commands/network/start.rs +++ b/cmd/soroban-cli/src/commands/network/start.rs @@ -139,11 +139,9 @@ fn get_image_name(cmd: &Cmd) -> String { _ => "latest", // default to latest for local and pubnet }; - if cmd.image_tag_override.is_some() { - let override_tag = cmd.image_tag_override.as_ref().unwrap(); - println!("Overriding docker image tag to use '{override_tag}' instead of '{image_tag}'"); - - image_tag = override_tag; + if let Some(image_override) = &cmd.image_tag_override { + println!("Overriding docker image tag to use '{image_override}' instead of '{image_tag}'"); + image_tag = image_override; } format!("{DOCKER_IMAGE}:{image_tag}")