From 48c04031a4721e8dd3ea00f9fa351e9ff6f7fa14 Mon Sep 17 00:00:00 2001 From: Austin Liu Date: Mon, 2 Sep 2024 18:09:09 +0800 Subject: [PATCH] Simplify pattern matching Signed-off-by: Austin Liu --- src/upload.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/upload.rs b/src/upload.rs index 267b6ca2c..8ee18e47a 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -322,8 +322,8 @@ fn complete_registry(opt: &PublishOpt) -> Result { { let normalized_url = PublishOpt::normalize_url(repository_url); let name = match normalized_url { - normalized if normalized == PublishOpt::DEFAULT_REPOSITORY_URL => Some("pypi"), - normalized if normalized == PublishOpt::TEST_REPOSITORY_URL => Some("testpypi"), + PublishOpt::DEFAULT_REPOSITORY_URL => Some("pypi"), + PublishOpt::TEST_REPOSITORY_URL => Some("testpypi"), _ => None, }; (name, repository_url.to_string())