From 2895ce449545b388bc0c22e4b091f6eded643b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 18 Dec 2022 22:33:44 +0100 Subject: [PATCH] Regroup the chained calls to `.replace()` into a single one --- acme_common/src/crypto.rs | 2 +- acmed/src/config.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acme_common/src/crypto.rs b/acme_common/src/crypto.rs index e8fc314..a2d0592 100644 --- a/acme_common/src/crypto.rs +++ b/acme_common/src/crypto.rs @@ -58,7 +58,7 @@ impl FromStr for BaseHashFunction { type Err = Error; fn from_str(s: &str) -> Result { - let s = s.to_lowercase().replace('-', "").replace('_', ""); + let s = s.to_lowercase().replace(['-', '_'], ""); match s.as_str() { "sha256" => Ok(BaseHashFunction::Sha256), "sha384" => Ok(BaseHashFunction::Sha384), diff --git a/acmed/src/config.rs b/acmed/src/config.rs index 2e3d134..894a641 100644 --- a/acmed/src/config.rs +++ b/acmed/src/config.rs @@ -483,7 +483,7 @@ impl Certificate { id.to_string() } }; - let name = name.replace('*', "_").replace(':', "_").replace('/', "_"); + let name = name.replace(['*', ':', '/'], "_"); Ok(name) }