From fd09d3164c86562869b8f405fc32dd97d6db90ae Mon Sep 17 00:00:00 2001 From: Gleb Novikov Date: Fri, 17 Jan 2025 15:34:38 +0000 Subject: [PATCH] shorter pg_port definition --- compute_tools/src/bin/fast_import.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compute_tools/src/bin/fast_import.rs b/compute_tools/src/bin/fast_import.rs index 275765bba46d..c8440afb64e9 100644 --- a/compute_tools/src/bin/fast_import.rs +++ b/compute_tools/src/bin/fast_import.rs @@ -106,12 +106,10 @@ pub(crate) async fn main() -> anyhow::Result<()> { let working_directory = args.working_directory; let pg_bin_dir = args.pg_bin_dir; let pg_lib_dir = args.pg_lib_dir; - let pg_port = if args.pg_port.is_some() { - args.pg_port.unwrap() - } else { + let pg_port = args.pg_port.unwrap_or_else(|| { info!("pg_port not specified, using default 5432"); 5432 - }; + }); // Initialize AWS clients only if s3_prefix is specified let (aws_config, kms_client) = if args.s3_prefix.is_some() {