From c32b6f2f379c91e0f1ee2cb029b007c0e398145f Mon Sep 17 00:00:00 2001 From: heihutu <30542132+heihutu@users.noreply.github.com> Date: Fri, 27 Feb 2026 02:34:09 +0800 Subject: [PATCH] refactor region parsing (#1981) --- rustfs/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index eeaee5206..cecdf5cf8 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -163,11 +163,11 @@ async fn run(config: config::Config) -> Result<()> { // 1. Initialize global readiness tracker let readiness = Arc::new(GlobalReadiness::new()); - if let Some(region) = &config.region { - let region = region + if let Some(region_str) = &config.region { + region_str .parse() - .map_err(|e| Error::other(format!("invalid region {}: {e}", region)))?; - rustfs_ecstore::global::set_global_region(region); + .map(rustfs_ecstore::global::set_global_region) + .map_err(|e| Error::other(format!("invalid region '{}': {}", region_str, e)))?; } let server_addr = parse_and_resolve_address(config.address.as_str()).map_err(Error::other)?;